Bug 1044585 - virt-builder network (eg. --install) doesn't work if resolv.conf sets nameserver 127.0.0.1
Summary: virt-builder network (eg. --install) doesn't work if resolv.conf sets nameser...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-18 15:37 UTC by Richard W.M. Jones
Modified: 2013-12-18 19:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-18 19:17:04 UTC
Embargoed:


Attachments (Terms of Use)
0001-appliance-Create-an-etc-resolv.conf-file-referring-t.patch (1.92 KB, patch)
2013-12-18 16:06 UTC, Richard W.M. Jones
no flags Details | Diff

Description Richard W.M. Jones 2013-12-18 15:37:31 UTC
Description of problem:

If the *host* has /etc/resolv.conf containing:

nameserver 127.0.0.1

(or ::1 or similar), then virt-builder's network options such
as --install don't work.  The reason is that /etc/resolv.conf
gets copied verbatim into the guest, but an address like 127.0.0.1
doesn't make sense from inside the appliance.

Version-Release number of selected component (if applicable):

virt-builder 1.24.2

How reproducible:

100%

Steps to Reproduce:
1. Have /etc/resolv.conf containing nameserver 127.0.0.1
2. Run virt-builder fedora-19 --install foo

Actual results:

yum / apt / etc fails to resolve repositories.  A typical
error would be:

Error: Cannot retrieve metalink for repository: fedora/19/x86_64. Please verify its path and try again

but the errors can vary depending on the guest being installed.

Expected results:

Network options should work.

Additional info:

Found by Lukáš Zapletal (lzap).

Comment 1 Richard W.M. Jones 2013-12-18 15:40:08 UTC
A workaround (if you have an http proxy) is to set:

export http_proxy=http://1.2.3.4:3128/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy

Note you must use a dotted quad, not a hostname, so that
name resolution isn't needed.

Comment 2 Richard W.M. Jones 2013-12-18 16:06:55 UTC
Created attachment 838415 [details]
0001-appliance-Create-an-etc-resolv.conf-file-referring-t.patch

Lightly tested patch.

Comment 3 Richard W.M. Jones 2013-12-18 19:17:04 UTC
I pushed this fix and will backport it to 1.24.3 in time.

https://github.com/libguestfs/libguestfs/commit/1fcea09ee2e89d2e727e39df80dc595f5d0ba363


Note You need to log in before you can comment on or make changes to this bug.