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

Discussions about using Linux guests in VirtualBox.
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

Windows Vista Ultimate is my host and CentOS 5.3 is my guest OS and I'm using the latest version of VirtualBox. My Windows public IP address is xx.xxx.xx.xxx. Since CentOS has the same IP address as my Windows Vista host, I'd like to know if there's a way to give the CentOS guest it's own IP address.


MOD Edit: I have edited your post and removed the IP address. No need to give your public address as it has nothing to do with what you need and you really don't want everyone having it.
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 »

Select Bridged mode in VirtualBox settings and set the guest to use DHCP.
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

Perryg wrote:Select Bridged mode in VirtualBox settings and set the guest to use DHCP.
Okay I did that, but whenever I go to whatsmyip.com it gives me the same IP address that my Windows Vista host uses.
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 »

That is as it should be. It is picking up the IP that your provider is giving you. Remember that everything is virtual. If you can communicate with your machines and you are able to get to the internet then it is working as it should.
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

Perryg wrote:That is as it should be. It is picking up the IP that your provider is giving you. Remember that everything is virtual. If you can communicate with your machines and you are able to get to the internet then it is working as it should.
I am able to get onto the internet on the guest OS. But the guest OS is using the same IP address as the host OS. Is there a way where I can change the guest IP address?
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 »

If you have setup VBox to use Bridged and there are no other network adapter settings to other protocols it can not be using the same IP address.
Neither of the PC's that use that IP address would work.
Only thing that would cause that is if you had Host only mode setup as well.
Shut down you guest and look at the settings under network and make sure that you only have (1) adapter set and that it is set to bridged.
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

I only have 1 adapter active and it's attached to the bridged adapter.
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 »

Does everything work?
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

If you mean, am I getting internet connection on the guest OS, then yes it works. :P
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 »

Then enjoy and the rest will come in time.
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 »

xlovergirl instead of using myip.com which will show your public address which might be different from the one you really use.
Do this instead

In windows start cmd
ipconfig
find the ip there

on centos
in terminal
ifconfig

compare the results....
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

I know what you mean. Theres a private IP address which are usually something like 192.168.1.1 and there's a public IP address like 24.113.xx.xxx.

I'm trying to get a different public IP address for my virtual machine if it's possible.
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 »

Do you have a router?
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 »

Also in what range is the ip address you see inside your boxes as I showed in my first post. Show us the first two groups from that.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
xlovergirl
Posts: 7
Joined: 2. May 2009, 01:34
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: CentOS 5.3 & Ubuntu 9.04

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

Post by xlovergirl »

Yes I do have a router. My guest OS and host OS both have different private IP addresses. But same public IP addresses.
Post Reply