Page 1 of 1

Assign static IP to a guest in host-only DHCP network?

Posted: 7. May 2012, 23:53
by avamk
Hello,

I've setup a couple of guest machines in VirtualBox 4.1.14 in the same host-only network with DHCP. How do I assign static IP addresses to those machines?

Thanks!

Re: Assign static IP to a guest in host-only DHCP network?

Posted: 8. May 2012, 00:18
by Perryg
Just set them up in the guest. You have to use the same subnet as the host.

Re: Assign static IP to a guest in host-only DHCP network?

Posted: 8. May 2012, 03:41
by avamk
Perryg wrote:Just set them up in the guest. You have to use the same subnet as the host.
Hello,

I think I am doing something wrong:

I tried your suggestion with my Scientific Linux 6.2 guest by going to the Gnome Network Connections manager, setting the IPv4 settings to manual, and adding an address like so: IP 192.168.56.101 (the first address available in VirtualBox host-only network settings, netmask 255.255.255.0 (also from the host-only settings). This client seems to connect fine.

However, I started a second guest machine (with dynamically assigned host-only network IP) while the first one is still on, and noticed that it received the same 192.168.56.101 address as the first Scientific Linux guest!

Looks like my VirtualBox host is not aware of the first guest with manually assigned IP?

Re: Assign static IP to a guest in host-only DHCP network?

Posted: 8. May 2012, 04:10
by Perryg
Well that is probably because you are using the addresses in the DHCP server range (see preferences -> network). Use one that is not in the DHCP rage but the same subnet if you want to assign static addresses.

Re: Assign static IP to a guest in host-only DHCP network?

Posted: 8. May 2012, 05:45
by avamk
Perryg wrote:Well that is probably because you are using the addresses in the DHCP server range (see preferences -> network). Use one that is not in the DHCP rage but the same subnet if you want to assign static addresses.
Ah yes, that seems to be the problem. I made the appropriate adjustments and it works well now. Thank you!