Access Parallels Windows localhost from Mac

MacosWindows 7LocalhostVirtual MachineParallels

Macos Problem Overview


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).

Any idea ? Is it possible ?

Macos Solutions


Solution 1 - Macos

The above didn't help me, but this did:

  • Go to Windows VM, go to Start --> Run... --> type cmd.exe

  • The windows command line opens. Type ipconfig and find out your IP4-adress.

  • Edit your macs hosts file as described in this blogpost. Put in the following line, replacing my windows VMs local IP (here 10.211.55.5) with the one you found out in the step before:

     10.211.55.5   windows
    

Then, you can access the localhost of windows using win instead of localhost, for example http://windows:8080/someapp

Solution 2 - Macos

I had the same problem as you Ranch. I'm running Win7 on Mac OS X (Snow Leopard) / Parallels 5. I solved my localhost problem on mac , by turning off win7 firewall and "enable" anonymous authentication in Authentication setting in IIS Manager.

Also I've configured in parallels:

  1. Configure - hardware - Network adapter 1: Default Adapter

  2. Preferences - network - connection type - shared networking

Edit: For Parallels 8

  1. Configure > Hardware > Network adapter 1: Default Adapter

  2. Preferences > Advanced > Network: Change Settings > Shared

Solution 3 - Macos

This depends on how your network card is setup in the virtual machine. I don't know how it is in parallels, but in VMWare Fusion you can either set it up as "bridged" (which means sharing the same ip with the host), "NAT" which means it will have it's own private ip address and connect to the internet through the host , or "Private network" which means it will have a private IP address and will not connect to the internet. In the second and third case you can access the web server running on windows using the private ip address of the virtual machine, but in the bridge case I don't think this can be done.

Solution 4 - Macos

Sounds to me like your Parallels config is set to Host-Only networking for the Guest. Switching to Shared Networking should give your guest Windows OS a local IP address.

Then, you will have to access the Windows local IP address (not 127.0.0.1) from the Mac browser. You can find out the IP address to use by opening a command prompt in the Windows guest and taking a look at the output of the ipconfig command.

Solution 5 - Macos

I have followed the instructions above and Akku's provided the important hint, although for me it did not work. When I run ipconfig in the windows command line, I get 10.211.55.3 as an IPv4-Address and 10.211.55.1 as the standard gateway. Using 10.211.55.3 in the windows hosts file (C:\Windows\System32\drivers\etc\hosts) did not work - not sure why. So I tried: 10.211.55.2 and it worked.

Summing up: you have to set up your apache virtual host config first as described and then you have to open: C:\Windows\System32\drivers\etc\hosts and enter: 10.211.55.2 mysite.localhost (or whatever you defined in your virtual host config file). Hope this helps for those with the same problem as me.

I found this here: http://sirprize.me/scribble/accessing-localhost-on-lion-host-with-windows-guest-on-parallels/

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRanchView Question on Stackoverflow
Solution 1 - MacosAkkuView Answer on Stackoverflow
Solution 2 - MacosArefinView Answer on Stackoverflow
Solution 3 - MacosmateiView Answer on Stackoverflow
Solution 4 - MacosCoxyView Answer on Stackoverflow
Solution 5 - MacoscriscomView Answer on Stackoverflow