4

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?

2 Answers 2

4

The only thing really necessary is figuring out the IP address of the Mac host, and browse to that IP address on the Windows client machine.

For example, if your Mac host has the IP address 10.0.1.35, you should be able to browse to http://10.0.1.35.

If you have configured a firewall on the Mac, you probably want to disable that, or allow communication on port 80 to pass.

If you have configured named based virtual hosts in Apache, additionally you'll want to add entries to Windows' hosts file in %SystemRoot%\system32\drivers\etc\hosts, for example:

10.0.1.35 epwbst
2
  • Thanks! This works. Do you have a suggestion for configuring either Parallels or Windows because I constantly change network locations (thus my Mac's IP address is always changing). As a tip to others, edit hosts using administrative privileges (either on Windows or on MacOS X). I used Notepad with admin privileges on (right-click and select use as admin). Commented Nov 15, 2012 at 7:21
  • @AveryChan I assume you can choose different network configuration but I have no experience with it. From my experience with VirtualBox, a host-only network looks like what you needs and create a new internal subnet for both host and guest to share.
    – Gerry
    Commented Nov 15, 2012 at 8:37
6

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.

1
  • 1
    I tried 12 different solutions to this problem, yours was the one that finally worked. THANK YOU
    – jessegavin
    Commented Mar 28, 2014 at 17:01

You must log in to answer this question.

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