Page 1 of 1

Bridge network question

Posted: 4. Mar 2010, 20:17
by tennisgeek
I installed 3.1.4 on Snow Leopard, and using Ubuntu guest.
Network is sort of working but I am scratching my head about it.
(Well, if I change /etc/resolv.conf along with "route add default gw" to my actual gateway, it works.)
When I use "bridge", the guest Ubuntu still gets DHCP lease from the host Mac OS X.
I know it's the MacOS X host since /etc/resolv.conf has the IP address of the host Mac OS X.
If it's NAT, I understand. But for "bridge", NAT's DHCP needs to stop, and I don't know how.

Thanks.

Re: Bridge network question

Posted: 4. Mar 2010, 21:02
by Perryg
Using Bridged you should be getting this information from your router.
Do you have a router in the network? Or are you trying to bridge to the host and do the routing there?

Re: Bridge network question

Posted: 4. Mar 2010, 21:29
by tennisgeek
The MacOS X host gets the DHCP lease correctly from the server (which is a dd-wrt, if you care.)

Re: Bridge network question

Posted: 4. Mar 2010, 21:41
by tennisgeek
Perryg wrote:Using Bridged you should be getting this information from your router.
Do you have a router in the network? Or are you trying to bridge to the host and do the routing there?
I'm not asking about DNS address or routing, nor asking about how DHCP server should be set up in my network, nor "there should be a router" in my network.
I thought that my original post was sufficient to indicate that even the Ubuntu guest's network is working correctly if I manually set the /etc/resolv.conf and default routing.

I'm asking about how to make MacOS X host's VirtualBox to not do DHCP lease to the guest when the network is set to bridge.

Thanks.

Re: Bridge network question

Posted: 4. Mar 2010, 22:49
by Perryg
I simply asked so I would know. Just because you know what you were talking about does not mean anyone else would.
Evidently this has become personal to you and I need to back away.

Re: Bridge network question

Posted: 5. Mar 2010, 00:18
by tennisgeek
I am totally cool about it. Thanks for the reply anyway.

Do you have any suggestion about how to stop the DHCP lease from the VirtualBox on MacOS X to the guest?
I suspect some kind of setting that I missed or killing a background process gets the job done.

Thanks.

Re: Bridge network question

Posted: 5. Mar 2010, 01:06
by Perryg
You shut down the VirtualBox dhcp server with the following command:

Code: Select all

VBoxManage dhcpserver --disable
You can see the rest of the commands to control VirtualBox and guests in your VirtualBox Users Guide.

Re: Bridge network question

Posted: 5. Mar 2010, 19:58
by tennisgeek
Alrighty!

(a) Using the VBoxManage to disable DHCP server
You do
VBoxManage list dhcpservers
so that you get the name of DHCP server, then
VBoxManage dhcpserver -name <the-name> -disable

This solved the problem.

(b) After realizing that the DHCP is per virtual network, I opened the Network setting, and "edit" the vboxnet0 (? from top of my head).
Sure enough the dialog box has two tabs, and second is "DHCP server". That's what I missed.
By the time I discovered it, it was already disabled, probably because of (a)
What I did not know is that the DHCP on/off is per virtual network, so it's setting is in the separate dialog of virtual network.


From user's point of view, it would be nice if the installation creates two virtual networks, one with DHCP server for NAT and the other without DHCP server for bridge, and warns the user for the bridge connection using DHCP server, and not having DHCP server for non-bridge connection.
Also, when "bridge" is chosen, it would be nice if the UI forces you to pick the virtual network without DHCP server.

Anyway, I now know where to toggle.

Thanks for the help.

Re: Bridge network question

Posted: 8. Mar 2010, 09:28
by tennisgeek
FYI: If you update VirtualBox from 3.0 to 3.1. (Somewhat of OT.)
I updated VirtualBox on Ubuntu to 3.1.4 from 3.0.?, and bit me in the same way.
The command used for disabling DHCP server of VirtualBox is the same on MacOS X as Ubuntu.

$ VBoxManage list dhcpservers
Sun VirtualBox Command Line Management Interface Version 3.1.4
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

NetworkName: HostInterfaceNetworking-vboxnet0
IP: 192.168.56.100
NetworkMask: 255.255.255.0
lowerIPAddress: 192.168.56.101
upperIPAddress: 192.168.56.254
Enabled: Yes

$ VBoxManage dhcpserver modify --netname HostInterfaceNetworking-vboxnet0 --disable

And the bridge network works again.