Menu
Parallels For Mac Localhost Login
NB. Updated for Windows 10/VS2015 here.
I use Windows (7) OS as a development platform, running on a Mac / Parallels Desktop 5. I would like to access the Windows localhost - from the Mac side for testing purposes. I've found many solutions of accessing the other way around (access Mac's localhost from Windows) - but found no solution for this access direction (if any). Mac OS X is connected to this network via the Parallels Host-Only Networking adapter automatically created on your Mac during the Parallels Desktop installation. The addresses for Windows are provided by the Parallels DHCP server. Believe it or not, it’s easy to configure your network according to what your needs are.
I’ve got a Mac which is running a Windows 7 Parallels VM that I use for Microsoft Visual Studio 2013 development. I’m using the Express Edition of VS2013. If I code up a web application (maybe a web service or an ASP.NET Web API) and run it in the IDE, I can hit it from the browser on that machine at http://localhost:57017/api/test.
How can I consume this Windows 7 web service from my Mac?
First of all I need to know the IP address of my Win 7 machine. Fire up a “cmd' prompt and run “ipconfig”. In my case the 'IPv4 Address” is 10.211.55.3 Jixipix artista impresso 1 2 35.
To avoid having to remember and type this address, let’s add it to the “hosts” file on the Mac. Do this from the Terminal on the Mac using “sudo vi /private/etc/hosts” and add in a new line such as:
Sadly, if I fire up Safari on my Mac and try to browse to http://win7:57017/api/test or (http://10.211.55.3:57017/api/test), it won’t find the page. There are two reasons for this:
- By default, IIS Express only allows access to your Visual Studio websites via localhost, and
- The Windows 7 firewall will block incoming connections to this website.
Fortunately, both of these can be overcome thanks to the handy tips on this webpage. Read it for the details, but for my quick reference I need to do the following on the Windows 7 machine: Civilization: beyond earth 1 1 4.
Set Up Localhost Mac
- Edit the C:Users{UserName}Documents IISExpressconfigapplicationhost.config file and search for my website, adding the following binding (the localhost line will already be there - add the second line with the IP address): <bindingprotocol='http'bindingInformation='*:57017:localhost' />NB.This step needs to be done for each new website.
- Create a hole in the Windows 7 firewall using these two commands from a “Run as Administrator” cmd prompt: >netsh http add urlacl url=http://10.211.55.3:57017/ user=everyone
>netsh advfirewall firewall add rule name='IISExpressWeb' dir=in protocol=tcp localport=57017 profile=private remoteip=localsubnet action=allow
Parallels Access Mac Localhost
Now, firing up Safari on the Mac and browsing to http://win7:57017/api/test should work!