Discussion:
Updating the DHCP server setting for a host-only adapter doesn't work; the old DHCP server is still used.
Susam Pal
2011-09-16 18:37:52 UTC
Permalink
I am using VirtualBox 4.1.2 on Windows XP. I have running a Debian
6.0.2.1 virtual machine in VirtualBox. I see that after I update the
DHCP setting for a host-only network adapter, the DHCP setting is not
used by the Debian virtual machine. It still manages to get an IP
address assigned by the old DHCP server. Here are the steps I
performed listed down in detail to demonstrate the issue:

1. File > Preferences > Network > Add a host-only network.
"VirtualBox Host-Only Ethernet Adapter" was created.

2. Edit "Virtual Host-Only Ethernet Adapter" and set:

Adapter:
IPv4 Address: 192.168.20.1
IPv4 Network Mask: 255.255.255.0

DHCP Server:
Server Address: 192.168.20.100
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.20.101
Upper Address Bound: 192.168.20.254

3. I had a VM in which "Adapter 1" is set to: "Bridged Adapter". I
updated "Adapter 2" to "VirtualBox Host-Only Ethernet Adapter".

4. Booted my VM (It's running Debian 6.0.2.1). Upon running: ifup
eth1, I see that it gets DHCPACK from 192.168.20.100 and an IP address
of: 192.168.20.101.


So, everything is okay so far. Now, the issue I am facing follows in
the next 3 steps.


5. Now I 'poweroff' the VM.

6. Edit File > Preferences > Network > "VirtualBox Host-Only
Ethernet Adapter" and set:

DHCP Server:
Server Address: 192.168.20.110
Lower Address Bound: 192.168.20.111
(Left other fields untouched)

7. Now, if I boot my VM again and run: ifup eth1, I still see a
DHCPACK from 192.168.20.100 and it gets IP address: 192.168.20.101
again.

Why isn't the new DHCP setting being used?

Regards,
Susam Pal
http://blog.susam.in/ | http://cotpi.com/
Rance Hall
2011-09-16 20:52:08 UTC
Permalink
Post by Susam Pal
I am using VirtualBox 4.1.2 on Windows XP. I have running a Debian
6.0.2.1 virtual machine in VirtualBox. I see that after I update the
DHCP setting for a host-only network adapter, the DHCP setting is not
used by the Debian virtual machine. It still manages to get an IP
address assigned by the old DHCP server. Here are the steps I
 1. File > Preferences > Network > Add a host-only network.
"VirtualBox Host-Only Ethernet Adapter" was created.
            IPv4 Address: 192.168.20.1
            IPv4 Network Mask: 255.255.255.0
            Server Address: 192.168.20.100
            Server Mask: 255.255.255.0
            Lower Address Bound: 192.168.20.101
            Upper Address Bound: 192.168.20.254
 3. I had a VM in which "Adapter 1" is set to: "Bridged Adapter". I
updated "Adapter 2" to "VirtualBox Host-Only Ethernet Adapter".
 4. Booted my VM (It's running Debian 6.0.2.1). Upon running: ifup
eth1, I see that it gets DHCPACK from 192.168.20.100 and an IP address
of: 192.168.20.101.
So, everything is okay so far. Now, the issue I am facing follows in
the next 3 steps.
 5. Now I 'poweroff' the VM.
 6. Edit File > Preferences > Network > "VirtualBox Host-Only
            Server Address: 192.168.20.110
            Lower Address Bound: 192.168.20.111
            (Left other fields untouched)
 7. Now, if I boot my VM again and run: ifup eth1, I still see a
DHCPACK from 192.168.20.100 and it gets IP address: 192.168.20.101
again.
Why isn't the new DHCP setting being used?
Regards,
Susam Pal
http://blog.susam.in/ | http://cotpi.com/
I tend to not use vbox to configure network settings for just this
reason. The guest OS can (and often does) override this setting based
on its on internal instructions.

If I were you I would just use vbox to tell the vm how many network
adapters to emulate, what type of adapters they are, and how these
adapters are connected to (bridge, internal, whatever).

Then configure the guests to do what you want for each adapter.

HTH

Rance
Susam Pal
2011-09-16 21:25:17 UTC
Permalink
Post by Rance Hall
Post by Susam Pal
I am using VirtualBox 4.1.2 on Windows XP. I have running a Debian
6.0.2.1 virtual machine in VirtualBox. I see that after I update the
DHCP setting for a host-only network adapter, the DHCP setting is not
used by the Debian virtual machine. It still manages to get an IP
address assigned by the old DHCP server. Here are the steps I
 1. File > Preferences > Network > Add a host-only network.
"VirtualBox Host-Only Ethernet Adapter" was created.
            IPv4 Address: 192.168.20.1
            IPv4 Network Mask: 255.255.255.0
            Server Address: 192.168.20.100
            Server Mask: 255.255.255.0
            Lower Address Bound: 192.168.20.101
            Upper Address Bound: 192.168.20.254
 3. I had a VM in which "Adapter 1" is set to: "Bridged Adapter". I
updated "Adapter 2" to "VirtualBox Host-Only Ethernet Adapter".
 4. Booted my VM (It's running Debian 6.0.2.1). Upon running: ifup
eth1, I see that it gets DHCPACK from 192.168.20.100 and an IP address
of: 192.168.20.101.
So, everything is okay so far. Now, the issue I am facing follows in
the next 3 steps.
 5. Now I 'poweroff' the VM.
 6. Edit File > Preferences > Network > "VirtualBox Host-Only
            Server Address: 192.168.20.110
            Lower Address Bound: 192.168.20.111
            (Left other fields untouched)
 7. Now, if I boot my VM again and run: ifup eth1, I still see a
DHCPACK from 192.168.20.100 and it gets IP address: 192.168.20.101
again.
Why isn't the new DHCP setting being used?
Regards,
Susam Pal
http://blog.susam.in/ | http://cotpi.com/
I tend to not use vbox to configure network settings for just this
reason.  The guest OS can (and often does) override this setting based
on its on internal instructions.
If I were you I would just use vbox to tell the vm how many network
adapters to emulate, what type of adapters they are, and how these
adapters are connected to (bridge, internal, whatever).
Then configure the guests to do what you want for each adapter.
HTH
Rance
The guest isn't running any DHCP server. VirtualBox is set to provide
the DHCP service for the host-only adapter. So, it should not be
possible for the guest OS to override the DHCP service configured in
the VirtualBox settings.
Post by Rance Hall
From what I found, the guest OS continues to successfully get an IP
address assigned to itself from the first DHCP server IP address even
after I have changed the DHCP server IP address to something else in
VirtualBox. This looks to me like a configuration bug in VirtualBox
due to which the new DHCP configuration I have set is not being used.

Should I open a bug for this at http://www.virtualbox.org/wiki/Bugtracker ?

Regards,
Susam Pal
Rance Hall
2011-09-17 00:28:38 UTC
Permalink
On Fri, Sep 16, 2011 at 4:25 PM, Susam Pal <susam-***@public.gmane.org> wrote:

<snip>
Post by Susam Pal
The guest isn't running any DHCP server. VirtualBox is set to provide
the DHCP service for the host-only adapter. So, it should not be
possible for the guest OS to override the DHCP service configured in
the VirtualBox settings.
Post by Rance Hall
From what I found, the guest OS continues to successfully get an IP
address assigned to itself from the first DHCP server IP address even
after I have changed the DHCP server IP address to something else in
VirtualBox. This looks to me like a configuration bug in VirtualBox
due to which the new DHCP configuration I have set is not being used.
Should I open a bug for this at http://www.virtualbox.org/wiki/Bugtracker ?
Regards,
Susam Pal
I went back and re-read your OP and I think I misunderstood your
original post, I'm sorry for the noise.

I don't think this is a bug per-se.

OK so you run vbox and the host only network is enabled and has a dhcp
server running. Fine.

You have a client and it gets IP addresses properly.

You change the settings on the dhcp server and your new settings are
not respected.

So far this is exactly the behavior I'd expect.

If I had a real physical network it would behave exactly as you have
described and there would be no bug.

There is a missing step here. Somewhere the DHCP server service needs
to be restarted so that it rereads its configuration file and adjusts
itself to the new settings.

The problem is how do you restart the dhcp server service in vbox so
that the new settings are adopted.

There is no way to restart just the dhcp server service in vbox (maybe
there should be)

Try your test procedure this way:


Open vbox admin panel and run vm from it, ensure that ip addressing
works at all (you've done this)

Change dhcp server settings in preferences.

shutdown vm

shutdown admin panel

restart admin panel

check dhcp server settings, are they preserved? (should be yes)

start vm

are new settings respected? (they should be)


Keep in mind that the dhcp lease on the client has not expired yet,
and the client is going to want to reuse its current unexpired
settings. There will be a negotiation with the dhcp server over the
current lease that now represents an IP address outside the IP scope.

I see two possible issues here.

1) maybe you should file a feature request with the developers so that
the host only network settings can be reset on the fly and the
internal dhcp server service restarted manually.

2) maybe the negotiation over a current-but-no-longer-scoped ip
address is not working properly. This would be a bug report.

Let me know what you find out.

Rance

Loading...