Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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)

share|improve this question
2  
You need to change it to a Bridged network on the VM, or else bridge your virtual adapter and your normal Mac one, whether it's Wi-Fi or Ethernet. –  user3463 Apr 27 '12 at 20:32
    
For future reference: virtualbox.org/manual/ch06.html#networkingmodes –  Oliver Salzburg Apr 27 '12 at 20:34

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
I thought I tried this before, but it works now... –  JKirchartz Apr 27 '12 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. –  Topher Hunt May 19 at 15:17

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.