How do I access my apache web-server (running locally) from Windows 7 running on Parallels? I'm running Windows 7 from within Parallels running on MacOS X Lion. I've also setup a local apache server; I can access this server from MacOS X via any browser. I've configured this using a combination of /etc/hosts and configuring the vhosts file: typing in http://epwbst into my browser brings me to the expected website on the MacOS X side. Doing this on the Windows side doesn't do the right thing. I am able to access any other web resource.

I suspect that I need to reconfigure the DNS on the Windows side to look to the MacOS X side first. How do I do this?
First ensure you have set the type of your VM network as "Shared Network" (in Parallels open the VM Configure window > Hardware > Network). Don't know if it works with another network type.

From Parallels: browser test your OS X localhost:


  Parallels creates a little DHCP network for your virtual machines, and the OS X machine itself is at the gateway IP.   Go into Parallels > Preferences > Advanced > Network and the gateway is most likely the Start Address with a 0, 1 or 2 in front of it.  For example, my Start Address is 10.211.55.1 and in Internet Explorer I type http://10.211.55.2 to hit the webserver I have running on OS X at http://localhost:80.


So, go to your guest OS (Windows) and edit the hosts file (on Windows it's located at C:\Windows\system32\drivers\etc\hosts) to enter this Parallels gateway IP (in my case 10.211.55.2) and name of the VirtualHost you've configured in Apache:

10.211.55.2 myvirtualhostname.localhost
10.211.55.2 myvirtualhostname2.localhost


This does the trick as that IP address is going to be maintained by Parallels and will not change as you change your location.

Now you can access to myvirtualhostname.localhost (or whatever your VirtualHost is named on Apache) from guest's browser.