On Wed, Sep 19, 2018 at 10:32:24AM +0200, Gabriele Baldoni wrote:
Sorry for bothering you in this dev mailing list, I'm using
libguestfs to
customize some vm using as bases the ubuntu cloud images.
But I noticed that it takes a lot and then fails when trying to install a
packet.
Same behaviour on Ubuntu 18.04 and Centos 7.5
Ubuntu:
virt-customize 1.36.13
libvirtd (libvirt) 4.0.0
Centos:
virt-customize 1.36.10rhel=7,release=6.el7_5.2,libvirt
libvirtd (libvirt) 3.9.0
This is the command I run:
virt-customize --hostname ato_test --uninstall cloud-init --install
ifupdown --run-command 'useradd -p $(openssl passwd -1 pass) fos -s
/bin/bash && mkdir /home/fos && adduser fos sudo' -a test.img
If I run using --no-network is faster, but the install obviously does not
work.
The network/--no-network thing is a bug in Ubuntu's DHCP support. I
think it's this one:
https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1632405
From the log it also looks like packages can't be installed
because
name resolution isn't working, which could be related to the above.
This should however all work fine on CentOS since that's one of our
primary development platforms.
I'm not sure what else to say. If you wanted to investigate this
further then you might try compiling from source. With the package
built from source you could explore changing appliance/init to try to
fix the DHCP problem.
Make sure to read this first:
http://libguestfs.org/guestfs-building.1.html
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/