Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Monday, October 25, 2010

Static IP for Virtualbox Machine

Source
In theory I can set up a DHCP Server to serve the static IP addresses to a given DHCP client using the client's MAC address. However I was not able to find such a configuration possibility in the VirtualBox Manager GUI. You can do some basic configuration of the DHCP Server (like subnet etc.) but not at DHCP Client level.
-----------------------------------
I do not have a full solution for you (please see viewtopic.php?f=4&t=20843&p=142053#p142053) 
but I can share what I did.
I had "VirtualBox Host-Only Network" appear as a Network interface in my Host after installing Virtualbox. It was setup with a Static IP of 192.168.56.1. The user can also add more "VirtualBox Host-Only Network" NICS later from VirtualBox File>Preferences>Network.
When a Guest is setup with a Virtual network card , and you want to attach it to host-only adapter, the VBox GUI will have you attach that virtual NIC to a VirtualBox-NIC interface on your HOST. I chose the "VirtualBox Host-Only Network" from the drop-down menu.

Now back in the Host-Network-Properties, I can change the IP address, mask, dns etc. of this "VirtualBox Host-Only Network". I can ofcourse change my guest OS network properties to any IP settings I want. I would have thought that if the Guest NIC and "VirtualBox Host-Only Network" it is "attached" have the same IP subnet, broadcast address etc. there should be communication. But I have not been able to establish that link yet, hence the post.

hope to get an full answer from some VBox expert. -JPP

----------------------------------------
found the issue.
Its the order in which each Guest Operating system picks up the virtual NICs provided by Virtualbox. It cannot be assumed that:
Adapter 1
Adapter 2
Adapter 3
in the virtualbox guest settings will correspond to
eth0
eth1
eth2
within the Linux Guest OS. Atleast in my installation it was not.
The only option I had was to make myself a table of all MAC addresses as found by the guest OSes and find out which Virtual adapter that was in virtualbox settings. Then I had to make sure the subnets matched between those virtual adapters and my Host machine adapters that were connected to: e.g:
Guest: Adapter 1 [MAC 00-00-00-00-D8-10] > linked to > "VirtualBox Host-Only Ethernet Adapter #3" > IP subnet 10.1.1.0
Inside the guest eth3 was [MAC 00-00-00-00-D8-10]. So I had to assign IP subnet 10.1.1.0 to eth3
Did the same with all the other Guests and now they all see and talk to each other.
---------------------------------------------
Another way to do this is to actually assign static IP's *within* the VM, and not rely on external DHCP assigning the (hopefully) correct IP that you want.
2. Change from DHCP to static: http://www.cyberciti.biz/tips/howto-ubu ... ation.html

No comments: