Access Parallels Windows localhost from Mac [closed]
Asked Answered
G

5

92

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 ?

Groveman answered 20/4, 2010 at 8:19 Comment(3)
belongs on superuser.comKisung
Sadly this question is closed, leaving many unfulfilled. I wrote a gist here to answer this question for macOS, Parallels 11: gist.github.com/ernsheong/23c00e65219b10db7bc072772ea509d4Entente
This tutorial worked for me dontpaniclabs.com/blog/post/2015/08/25/…Hatley
C
33

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

Compliment answered 6/5, 2010 at 9:10 Comment(4)
Just to add one more information: I solved following this guide but instead of chosing Default adapter I chosed Wi-fi and then I used the new ip generated under "bindings" on website setting. +1.Stinking
To COMPLETELY turn off windows firewall, goto "Windows Firewall with Advanced Security" and make sure it's turned off for ALL profiles. The default I believe is just to turn it off for one.Midis
it worked <=> when joined with answer of AkkuMagnetism
I actually had the settings described above but it didn't work for me. What I did was add my windows 10 IP to the website bindings of my local IIS website over port 80 and added a matching inbound rule in firewall settings. Finally updated the hosts file on mac and it's working!Letter
E
47

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

Ey answered 18/2, 2013 at 15:40 Comment(11)
Great answer, thanks! Do you know if that ip address changes every time you start up the Windows VM?Burnham
For me it doesn't, therefore I guessed that Parallels hardwires one IP adress as long as it's possible to use that. But I'm pretty sure you can turn on a setting where the VM tries to get an IP from the DHCP every time it boots, so maybe you've turned that on?Ey
FYI: This solution still works 7 month after applied.Ey
This solution works with Parallels 12 and windows 10 on El Capitan.Spousal
I prefer this approach. It maintains a bit of isolation between environments and is easy to use.Nystagmus
Im getting a HTTP 400 Invalid Hostname error?Storer
I'm also getting the HTTP 400 Invalid Hostname error - did you figure it out?Chloro
Same 400 HTTP invalid Hostname error. How to fix?Rawls
@RobertBenedetto - To fix this, you need to go to IIS and configure 'windows' or whatever domain you're trying to use as a Host Name of a site you're running in IIS via Site > Edit Bindings > Add. This will only work with IIS because you can't configure your site with IIS Express.Obvolute
Worked beautifully. Thanks.Waggery
Adding an extra for the 400 HTTP on IIS Express. If you setup the binding with the IP, this will be resolved. #4867047Glary
C
33

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

Compliment answered 6/5, 2010 at 9:10 Comment(4)
Just to add one more information: I solved following this guide but instead of chosing Default adapter I chosed Wi-fi and then I used the new ip generated under "bindings" on website setting. +1.Stinking
To COMPLETELY turn off windows firewall, goto "Windows Firewall with Advanced Security" and make sure it's turned off for ALL profiles. The default I believe is just to turn it off for one.Midis
it worked <=> when joined with answer of AkkuMagnetism
I actually had the settings described above but it didn't work for me. What I did was add my windows 10 IP to the website bindings of my local IIS website over port 80 and added a matching inbound rule in firewall settings. Finally updated the hosts file on mac and it's working!Letter
S
1

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.

Siobhansion answered 20/4, 2010 at 8:36 Comment(5)
On Parallels , I've found two network options, Shared and Host-only. Tried them both, but I cannot access 127.0.0.1 from the Mac.Groveman
It's normal , 127.0.0.1 is not the ip of the virtual machine. Try going to windows, opening a cmd prompt and type ipconfig , see what ip you get, and try accessing that.Siobhansion
192.168.1.100 works fine on the Windows machine (loads the IIS homepage) while is not accessible from Mac. I guess there are some settings I need to do on the Parallels app.Groveman
also check your firewall settings on the windows machineSiobhansion
Turned of the firewall. Still cannot access 192.168.1.100Groveman
O
0

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.

Outturn answered 23/4, 2010 at 2:13 Comment(1)
Parallels is configured to Shared Networking Maybe there are other Parallels network settings ? DHCP sever is enabled. Port forwarding maybe (?) My local server IP is 192.168.1.100, Subnet Mask 255.255.255.0, Default Gateway 192.168.1.1Groveman
R
-1

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/

Rumor answered 2/4, 2013 at 16:0 Comment(3)
This is wrong I believe. OP was asking about guest Windows on Mac running parallels.Ligroin
yes, exactly. my answer is exactly about windows on mac running parallels.Rumor
This is the wrong way round.Diesis

© 2022 - 2024 — McMap. All rights reserved.