17

I am running Windows 7 within a virtual Machine from my Mac. I use Windows 7 for Visual Studio primarily and also to host a dev install of IIS. There are two things I need and I am not sure what networking mode is needed ...

  1. I need to be able to reach the IIS server (running on the VM) via HTTP from the Mac.

  2. The web browsers on the virtual machine need to be able to access the internet.

    Any suggestions? Thanks.

2
  • 1
    The short answer is bridged mode will almost always easier to use for getting your VM on the network. But if you are worried about security of the VM, or your network admin is worried about security of the network, then you may have to use NAT.
    – Zoredache
    Feb 1, 2011 at 22:06
  • 2
    I tried both NAT and Bridged mode. With NAT I was unable to reach the IIS server running in the VM. However with Bridged mode I was able to connect. In NAT mode the IP address of the VM was 192.168.x.x which is a different subnet than my local network. With Bridged mode the IP address was 10.x.x.x which is the same subnet as my LAN. Sounds like NAT is more secure .. is there any way to connect to a server running on the VM from the host when in NAT mode?
    – webworm
    Feb 1, 2011 at 22:16

3 Answers 3

17

For your requirements the NAT mode should work for you, just as a reminder.

  • NAT Mode : Your host computer (the Mac) will act as a gateway to the network for your virtual machines, nobody on your network (apart from the Mac) will be able to see them since they're sitting in a separate network

  • Bridged Mode : Your host computer (the Mac) will share its network connection with the virtual machines, they'll be sitting as if they were another computer on your network, everyone on the network will see them and be able to interact with them.

Both options will give you internet access if your host computer has Internet access.

6
  • 5
    +1, but you should also point out that bridged networking requires an additional IP address on the host's (external) network; NAT doesn't.
    – Massimo
    Feb 1, 2011 at 21:55
  • 1
    For NAT, you will also need to configure port forwarding so the Mac can access IIS on the VM.
    – LukeR
    Feb 1, 2011 at 21:55
  • 1
    Not necessary LukeR since the Mac is also the gateway and host of the NATed network
    – lynxman
    Feb 1, 2011 at 21:58
  • 1
    I would like to leave it as NAT but I can't seem to reach IIS (running in the VM) from my host. I try connecting to the IP address of the NAT adapter but it eventually times out. How would I setup port forwarding?
    – webworm
    Feb 1, 2011 at 22:12
  • Running vmware it should be working "by default", try pinging from your mac the IP of your VM, and from the VM the gateway of the NATed network (the gateway IP is your Mac), check that you don't have the firewall activated on the VM, if that doesn't work let me know and we can analyze deeper
    – lynxman
    Feb 1, 2011 at 22:19
2

You want bridged. Bridged will give it an IP from your network. So it will give you are 192.168.1.whatever number.

3
  • That's not entirely correct Cody, bridged network will expose the computer to unnecessary access from other computers on the network, NAT mode should be more than enough for what he's requesting.
    – lynxman
    Feb 1, 2011 at 21:52
  • 1
    I've never had NAT mode work to just connect to my computer. I've always had to do bridged. Feb 1, 2011 at 21:56
  • 1
    @lynxman Any idea of how to allow the host computer to access servers (like IIS) running on the VM when in NAT mode?
    – webworm
    Feb 1, 2011 at 22:18
1

Not VMWare, I use Virtualbox and I just setup the guest with two NICs. One for NAT, for accessing the internet. The other with Host-Only network, allowing me to access the IIS Server on the guest.

2
  • Had you used bridge mode you could have done all that with a single NIC and had a much simpler system. Mar 28, 2011 at 1:38
  • I switched from VirtualBox to VMWare and now I found out that VMWare bridged network does not work. I will use your solution untill I switch back to VirtualBox. If I only knew why I wasted time to switch to VMWare when I had no problems with VirtualBox ?
    – IvanP
    Jan 6, 2015 at 21:51

You must log in to answer this question.

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