[Libguestfs] [PATCH 1/2] appliance: Use dhclient instead of hard-coding IP address of appliance.

Richard W.M. Jones rjones at redhat.com
Wed Oct 1 19:00:28 UTC 2014

On Wed, Oct 01, 2014 at 05:20:28PM +0100, Daniel P. Berrange wrote:
> On Tue, Sep 30, 2014 at 04:44:04PM +0100, Richard W.M. Jones wrote:
> > qemu in SLIRP mode offers DHCP services to the appliance.  We don't
> > use them, but use a fixed IP address intead.  This changes the
> > appliance to get its IP address using DHCP.
> > 
> > Note: This is only used when the network is enabled.  dhclient is
> > somewhat slower, but the penalty (a few seconds) is only paid for
> > network users.  We could consider using the faster systemd dhcp client
> > instead.
> Little known fact - the kernel has a built-in DHCP [client].
> I wonder if it is possible to use   'ip=dhcp' as a kernel boot
> arg ? Apparently the kernel provides a /proc/net/pnp file which
> you'd symlink to /etc/resolv.conf for DNS setup.

Thinking about this for a while, I suspect we probably don't want to
use this.  Long-running appliance instances ought to have a process
(dhclient) which constantly renews the lease, if only to stop another
client from taking the same IP address that we are using.  Looking at
the kernel implementation, it does not do this.  (In fact this is
potentially a bug for kickstarts etc.)


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.

More information about the Libguestfs mailing list