Page 1 of 2

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

Posted: 2. May 2009, 01:40
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.

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

Posted: 2. May 2009, 01:55
by Perryg
Select Bridged mode in VirtualBox settings and set the guest to use DHCP.

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

Posted: 2. May 2009, 03:34
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.

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

Posted: 2. May 2009, 03:37
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.

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

Posted: 2. May 2009, 03:49
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?

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

Posted: 2. May 2009, 04:01
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.

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

Posted: 2. May 2009, 04:08
by xlovergirl
I only have 1 adapter active and it's attached to the bridged adapter.

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

Posted: 2. May 2009, 04:09
by Perryg
Does everything work?

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

Posted: 2. May 2009, 04:14
by xlovergirl
If you mean, am I getting internet connection on the guest OS, then yes it works. :P

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

Posted: 2. May 2009, 04:47
by Perryg
Then enjoy and the rest will come in time.

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

Posted: 2. May 2009, 07:11
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....

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

Posted: 2. May 2009, 07:25
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.

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

Posted: 2. May 2009, 07:29
by baf
Do you have a router?

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

Posted: 2. May 2009, 07:31
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.

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

Posted: 2. May 2009, 07:39
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.