Windows – Use VirtualBox to access site on host from guest

macosnetworkingvirtualboxwindows 7

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)

Best Answer

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.

Related Question