10.4: Networking between a Parallels VM and OS X

Aug 21, '07 07:30:00AM

Contributed by: datenimperator

I regularly use Parallels to test web sites on IE 6. Most of the time, I have those sites running locally on my Mac, using either Apache or Tomcat on OSX. I've had trouble trying to correctly address the server running on OS X from within a Windows app, until I found this way to ease my life.

Parallels comes with a network driver that adds two network interfaces, with one of them being used for shared networking. It provides DHCP services to the virtual machine, but the Mac side of it gets a dynamic address as well. However, it's better to set this to "DHCP with manual address" on OS X, choosing an IP address from the network that you've assigned to NAT in the Parallels application. That way IE running on Windows can easily find the right server to connect to.

Read on for the detailed explanation...

Open Parallels preferences, go to the Network tab, and make sure that the IP range entered for shared networking leaves out some numbers. For instance, I've used 10.211.55.10 - 10.211.55.254 for DHCP, leaving the numbers from 1 to 9 untouched. Make sure the network mask is set to 255.255.255.0

Open the OS X network preferences, choose the Parallels NAT adapter and set it to 'DHCP with manual address.' Use any adress from the free ones above, but not the "1". I've set the Mac to use 10.211.55.5, for example.

Start the Windows VM and edit the hosts file. (That probably depends on the version of Windows that you're using; mine is under C:WINDOWSsystem32etcdrivers). Add a line containing your Mac's IP from above, and a name of your liking. I've used 10.211.55.5 mbp.

Start IE or any other networking app, and using that given name will get you straight to your Mac's IP interface, ie. http://mbp:8000/ gives me my local instance of Tomcat. Just like that, I can get to my web sites being served on OS X from a browser running within a virtual machine. Hope that helps!

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070817025358357