[Libguestfs] Name resolution not working inside virt-customize

Lee Revell leer at inmotionhosting.com
Fri Mar 13 13:14:35 UTC 2015


On 03/12/2015 04:35 AM, Richard W.M. Jones wrote:
>> leer at eng-leer:~/libguestfs-1.29.29$ virt-builder fedora-21
>> --run-command "ping -c 4 172.16.12.200"
>> [   1.0] Downloading: http://libguestfs.org/download/builder/fedora-21.xz
>> [   1.0] Planning how to build this image
>> [   1.0] Uncompressing
>> [  28.0] Opening the new disk
>> [  31.0] Setting a random seed
>> [  31.0] Running: ping -c 4 172.16.12.200
>> connect: Network is unreachable
>> virt-builder: error: ping -c 4 172.16.12.200: command exited with an error
>
> Because of the non-root networking technology we use (SLIRP), 'ping'
> doesn't work and there are other shortcomings.  See:

I think the problem actually goes deeper than name resolution. On a 
Ubuntu 14.04 host the firstboot-command doesn't seem to be run at all 
and it appears that the network never gets configured. Here is a 
complete log. The same command, libguestfs + supermin version, and 
images all work perfectly on a Fedora 21 host.

Command tested:

$ ./run virt-builder fedora-21 --firstboot-command "echo 'testing' > 
/var/log/test" -v -x 2>&1 | tee virt-builder.log

This appears to succeed as the log shows, but then mounting the image 
with guestfish:

$ ./run guestfish -a fedora-21.img

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
       'man' to read the manual
       'quit' to quit the shell

 ><fs> run
 ><fs> mount /dev/sda3 /
 ><fs> ls /var/log/
README
anaconda
audit
journal
ppp
 ><fs> exit

Lee
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virt-builder.log
Type: text/x-log
Size: 98838 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20150313/aa7fd7a8/attachment.bin>


More information about the Libguestfs mailing list