How to give VirtualBox guest OS it's own IP address

Discussions about using Linux guests in VirtualBox.
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: How to give VirtualBox guest OS it's own IP address

Post by baf »

Ah you have a router!

The reason to have that is to protect your computers by only showing the routers ip-address to the world(public).
The inner machines gets private addresses which are kind of private......
Do you get my point?
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
baf
Volunteer
Posts: 829
Joined: 27. Sep 2008, 06:18
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7
Location: Luleå or Skellefteå, Sweden

Re: How to give VirtualBox guest OS it's own IP address

Post by baf »

Enough sarcasm describe how you have things connected and what your higher level goal is. Perhaps its reachable some other way.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to give VirtualBox guest OS it's own IP address

Post by Perryg »

To be able to get a second Public IP address your provider would need to give it to you. Call them and see if they will give you another address.
If they will give you a second one then all you need to do is put that one in the guest.
kenzy
Posts: 2
Joined: 4. May 2009, 03:47
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Windows7,centos,windows xp

Re: How to give VirtualBox guest OS it's own IP address

Post by kenzy »

I have strugled with this for a while...here is what I did...and it works; just figured it out today:

Install Bridge so Virtualbox VMs can get their own IP
1. Virtualbox -Settings, add network card for “Host-only Networks.”
2. Check mark Manual Configuration and add a network address: 192.168.0.100 (an addressed not used on your network) and subnet mask (ie 255.255.255.0. No DHCP Server
3. Go to Control panel>Network Connections, select the Local Area Connection and the Bridge you created. Right click the two highlighted and there is only one choice; I forget; it will create a Network Bridge
4. Go to your VM and set Network to Host-only Network and choose the Network adapter you created.

That's it...I set the same network adapter for each VM (Windows XP and Linux)...they end up each going to the dhcp on the router and getting an address of their own. I don't have to do any port forwarding or any of that jazz. Good luck.
Post Reply