Static IP not working

This is for discussing general topics about how to use VirtualBox.
Post Reply
BigDriver
Posts: 3
Joined: 11. Oct 2012, 04:21

Static IP not working

Post by BigDriver »

I've got a winXP host machine and win7 installed on VirtualBox. When the virtual machine has the internet setting set to "obtain... automatically" everything works fine and the vm can connect to the internet. But when I set the IP manually (to the same thing listed when the 'ipconfig' command is run - 10.0.2.15), the internet connection goes down. VirtualBox Network setting has Adapter 1 'attached to' NAT. Both the Default Gateway and Preferred DNS Server options are set to 10.0.2.2. What am I missing?
martyscholes
Posts: 202
Joined: 11. Sep 2011, 00:24
Primary OS: Solaris
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win 7, Ubuntu, Win XP, Vista, Win 8, Mint, Pear, Several Linux Virtual Appliances

Re: Static IP not working

Post by martyscholes »

Do you have the correct subnet mask?
BigDriver
Posts: 3
Joined: 11. Oct 2012, 04:21

Re: Static IP not working

Post by BigDriver »

martyscholes wrote:Do you have the correct subnet mask?
255.255.255.0
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Static IP not working

Post by BillG »

Why do you want to change the IP? NAT has a built-in DHCP server which gives you the required network config to work through NAT.

If you want the vm to use a static IP you will need to change the networking type to bridged. It will still get its config automatically if you have a DHCP server on the physical network but you can set it to a static IP if you so desire.
Bill
BigDriver
Posts: 3
Joined: 11. Oct 2012, 04:21

Re: Static IP not working

Post by BigDriver »

Changed to Bridged, and still no connection... ??
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Static IP not working

Post by BillG »

What did you bridge it to? What does the network look like? There just isn't enough info to comment.
Bill
Post Reply