5

I'm running VirtualBox on a Mac (host), the VM i'm using is windows 7 (guest). VirtualBox is setup to use the NAT network adapter, and I'm able to get to the internet just fine (google, msn, everything) however I'm hosting a site on the Mac(host) and I cannot access it from the VM.

The guest is assigned the IP 10.0.2.10 and my host's IP is 10.0.2.100, I think the issue might be that these are separate networks, but I don't know. I just want to test the site in IE (I don't have a separate/remote server to host it on)

2

2 Answers 2

6

You should really consider switching from NAT to bridged mode. This way both "systems" will be on the same network. When you run with NAT it subnets the network and your VM effectively exists in another network. In order to make it work with NAT you will need to configure (through configuration files, not GUI options) the NAT routing to open connections/ports between the networks, and also setup routing tables.

If you set bridged mode, the VM requests the IP from the same router that your host does, instead of from the VM system on the host. In turn it will be as easy as just going to the IP of your host.

2
  • I thought I tried this before, but it works now...
    – JKirchartz
    Apr 27, 2012 at 20:36
  • Thanks for this. One comment for any other readers: to access a website at localhost on the host (for example Rails development sites run at localhost:3000), enter in the host's IP plus port: eg. 10.0.0.5:3000. If this doesn't work, ensure the http:// is there (some browsers are picker than others) and also check firewall settings on the host. May 19, 2014 at 15:17
2

By default the network adapter is "NAT" mode. You need to put your network adapter in bridge mode. Here are the steps.

1> On the virtual box select the vm you want " Eg win7" 2> Go to settings -> Network -> Adapater1

 Change that from NAT -> Bridged Adapter 

3> Reboot your guest VM

Hope that should resolve your issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .