Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer
    
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). –  Avery Chan Nov 15 '12 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 Nov 15 '12 at 8:37

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.

share|improve this answer
    
I tried 12 different solutions to this problem, yours was the one that finally worked. THANK YOU –  jessegavin Mar 28 at 17:01

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.