How can I access IIS server on my macbook from another device

I installed windows and IIS in a free windows emulator on my MacBook. However, how do I connect to IIS's IP address from my browser on another device? IIS's / Windows emulator has a different IP address than the one my MacBook has. The windows emulator is doing some sort of NAT for out bound traffic because I can use Internet explorer with in the windows emulator to access the Internet. However, when i point my iphone browser to either the ip address of the Windows emulator or my MacBook neither get routed to IIS. Note this works fine on my PC laptop. My IIS code is my API for a web app that I now want to write a native iPhone app to use as well. I would like to let IIS run the API inside the windows emulator on my MacBook while I use my iPhone to hit the API over the same wifi network that my MacBook is connected to so I don't have to continue to use my PC laptop.

Thanks for your help in advance,

Rick

Posted on May 11, 2017 12:43 AM

Reply
3 replies

May 11, 2017 10:59 PM in response to RickiOS

You would need to start listening & route a port on the Mac into the relevant port(s) of the IIS server.


One way would be to enable ssh on the Mac. Then you can ssh into the Mac (from the Mac itself) and tie the port on the IIS server to a port that is available on the local network. It seems crazy but you are basically making a tunnel that listens externally & sends data to the VM & allowing access from the Macs network connection.


The first example here may cover it…

http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html

$ ssh user@work.example.org -L 10000:172.16.10.10:22

That connects to work.example.org (which would be your Macuser@localhost) and adds a listening port on 10000 that redirects to the 172.x address (which you swap for the IP & port of the IIS server inside the local VM).

From other devices use IP. of.Mac:10000 to view the IIS server content (bonjour name or hostname of the Mac should work too).


That may be overkill or too complex but it might get your testing done. I suspect you can use netcat to do it too but I may be wrong. Look at the manuals (man ssh and man nc in Terminal)

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPag es/man1/ssh.1.html

(supposedly OS X uses the BSD netcat, I can't see Apples own manual online)

http://www.manpagez.com/man/1/nc/


Parallels may just create the same problem as VM's tend to like to bridge or use NAT to isolate. Personally I prefer to redirect outside the VM otherwise they tend to break of for me when setting up the network interface to use an IP that is on the LAN 😝



P.S. Virtualbox has a port forward option so you could forward port 8080 on the Mac to 80 in the VM. Parallels might have one too as may your 'Windows Emulator', read up on privileged ports if it is not clear why ports below 1024 are not accessible without root.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I access IIS server on my macbook from another device

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.