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

Discussions about using Linux guests in VirtualBox.

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

Postby xlovergirl » 2. May 2009, 01:40

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.
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

Postby Perryg » 2. May 2009, 01:55

Select Bridged mode in VirtualBox settings and set the guest to use DHCP.
Perryg
Site Moderator
 
Posts: 25964
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

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

Postby xlovergirl » 2. May 2009, 03:34

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.
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

Postby Perryg » 2. May 2009, 03:37

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.
Perryg
Site Moderator
 
Posts: 25964
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

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

Postby xlovergirl » 2. May 2009, 03:49

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?
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

Postby Perryg » 2. May 2009, 04:01

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.
Perryg
Site Moderator
 
Posts: 25964
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

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

Postby xlovergirl » 2. May 2009, 04:08

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

Postby Perryg » 2. May 2009, 04:09

Does everything work?
Perryg
Site Moderator
 
Posts: 25964
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

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

Postby xlovergirl » 2. May 2009, 04:14

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

Postby Perryg » 2. May 2009, 04:47

Then enjoy and the rest will come in time.
Perryg
Site Moderator
 
Posts: 25964
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX - Other

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

Postby baf » 2. May 2009, 07:11

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".
baf
Volunteer
 
Posts: 829
Joined: 27. Sep 2008, 06:18
Location: Luleå or Skellefteå, Sweden
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7

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

Postby xlovergirl » 2. May 2009, 07:25

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.
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

Postby baf » 2. May 2009, 07:29

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
Location: Luleå or Skellefteå, Sweden
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7

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

Postby baf » 2. May 2009, 07:31

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".
baf
Volunteer
 
Posts: 829
Joined: 27. Sep 2008, 06:18
Location: Luleå or Skellefteå, Sweden
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: linux,xp,win7

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

Postby xlovergirl » 2. May 2009, 07:39

Yes I do have a router. My guest OS and host OS both have different private IP addresses. But same public IP addresses.
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

Next

Return to Linux Guests

Who is online

Users browsing this forum: Google [Bot], Perryg and 20 guests