Lee Revell
2015-Mar-13 15:28 UTC
Re: [Libguestfs] Name resolution not working inside virt-customize
On 03/13/2015 11:13 AM, Richard W.M. Jones wrote:> > Yes, the log indicates name resolution not working. Please try the > diagnosis steps that I outlined in: > > https://www.redhat.com/archives/libguestfs/2015-March/msg00075.htmlSorry, I somehow missed the above message. $ ./run guestfish get-backend direct Here are the outputs of the /dev/tcp test, first doing: $ ./run guestfish -v -x --network -a /dev/null run : debug sh 'exec 3<> /dev/tcp/google.com/80 ; echo -e "GET /\n" >&3 ; cat <&3' And then by IP: $ ./run guestfish -v -x --network -a /dev/null run : debug sh 'exec 3<> /dev/tcp/173.194.121.5/80 ; echo -e "GET /\n" >&3 ; cat <&3' Both fail... Lee
Richard W.M. Jones
2015-Mar-13 16:21 UTC
Re: [Libguestfs] Name resolution not working inside virt-customize
On Fri, Mar 13, 2015 at 11:28:56AM -0400, Lee Revell wrote:> On 03/13/2015 11:13 AM, Richard W.M. Jones wrote: > > > >Yes, the log indicates name resolution not working. Please try the > >diagnosis steps that I outlined in: > > > >https://www.redhat.com/archives/libguestfs/2015-March/msg00075.html > > Sorry, I somehow missed the above message. > > $ ./run guestfish get-backend > direct > > Here are the outputs of the /dev/tcp test, first doing: > > $ ./run guestfish -v -x --network -a /dev/null run : debug sh 'exec > 3<> /dev/tcp/google.com/80 ; echo -e "GET /\n" >&3 ; cat <&3' > > And then by IP: > > $ ./run guestfish -v -x --network -a /dev/null run : debug sh 'exec > 3<> /dev/tcp/173.194.121.5/80 ; echo -e "GET /\n" >&3 ; cat <&3' > > Both fail...So what's happening is that /etc/resolv.conf in the appliance never gets created. *If* /etc/resolv.conf had been created then we should see evidence that this code had been run: https://github.com/libguestfs/libguestfs/blob/master/daemon/command.c#L148-L215 (eg. the "renaming ... to ..." messages should appear). Question is why does /etc/resolv.conf not get created? On Fedora, it is created by dhclient running from appliance/init: https://github.com/libguestfs/libguestfs/blob/master/appliance/init#L88-L94 On Debian/Ubuntu that is supposed to run dhclient if available or dhcpcd if not. Run `./run virt-rescue --network --scratch' on the Ubuntu host and see if: - either dhclient or dhcpcd exists in the appliance - they work when you run them, or if there is an error message - if running one of them creates /etc/resolv.conf I don't see any error in the log from either dhclient or dhcpcd, so I have to assume that one of them ran, but perhaps there is some other problem. Also perhaps the packagelist (appliance/packagelist.in) doesn't list the right package containing dhclient/dhcpcd. Also maybe a different dhcp client is needed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Lee Revell
2015-Mar-13 16:58 UTC
Re: [Libguestfs] Name resolution not working inside virt-customize
On 03/13/2015 12:21 PM, Richard W.M. Jones wrote:> So what's happening is that /etc/resolv.conf in the appliance never > gets created. >Is the /dev/tcp test by IP evidence that the problem goes deeper than name resolution?> Run `./run virt-rescue --network --scratch' on the Ubuntu host and see if: > > - either dhclient or dhcpcd exists in the appliance > > - they work when you run them, or if there is an error message > > - if running one of them creates /etc/resolv.conf >><rescue> which dhclient /sbin/dhclient ><rescue> /sbin/dhclient ><rescue> ls /etc/resolv.conf ls: cannot access /etc/resolv.conf: No such file or directory ><rescue> which dhcpcd ><rescue> Would there be any point in testing latest code from git? Lee
Apparently Analagous Threads
- Re: Name resolution not working inside virt-customize
- Re: Name resolution not working inside virt-customize
- Re: Name resolution not working inside virt-customize
- Re: Name resolution not working inside virt-customize
- [PATCH v2] appliance init: find NIC name for dhcpcd