-
-
Save jmwhittaker/869300 to your computer and use it in GitHub Desktop.
Connect to your Mac's localhost from within a VMWare virtual machine. | |
- Boot up VMware and fire up your VM (i'm using Windows 7) | |
- Make sure that the VM is using NAT | |
- Fire up the command prompt in Windows and type "ipconfig". IN the resulting text look for your IPv4 address. It will be something like 192.168.xxx.xxx | |
- Now go to your browser in your VM and type that ip address into the url bar but change the last set of digits to be 2 (or 1). | |
- so as an example if your ip was found to be 192.168.213.200 change it to be 192.168.213.2 | |
- Assuming that your localhost is running on your mac you should get your localhost in your VM browser. | |
- If you need to add a non standard port number on the end like 8090 go ahead and do so. | |
Adding to a hosts file | |
- Make a new entry in the hosts file that maps to this address. You can't add custom port numbers in a Windows hosts file. |
This worked for me, but I had to also add a second network adapter set to 'Host-only'.
For what it's worth, my set-up is as follows:
- Mac OS X Yosemite 10.10.1
- Default OS X Apache and PHP
- VirtualHostX for creating the virtual hosts on my Mac
Who would have thought it could be that easy. Working great, thanks
You the man
I'm curious, is there a particular reason for changing the found ip from 192.168.213.200
to 192.168.213.2
?
One of my ports (9000) works, but 1234 and 34212 does not. Any advice?
Woah. Only one of my dev servers works on port 9000. If I try to switch what was on 1234 over to 9000, it doesn't work. That seems like some sort of project config not a VMware thing. Will share when I get to the bottom of this
Answer Edit: webpack dev server needs to be run with flag --host 0.0.0.0
if you want it to accept requests from outside your local machine (in your local network).
Worked perfectly! ✨
Thanks to @Kwon11, I finally figured out how to connect to my macOS Hugo server from Windows IE Edge tester box.
On my mac, when firing up the Hugo server:
hugo serve --port=1337 --bind=0.0.0.0
Then, on my macOS, get IP from System Preferences > Network and use that in Edge to connect:
http://192.168.0.16:1337/
My VMWare Fusion is setup to use NAT.
I get "403 Forbidden" error on my windows 7 virtual machine... any ideas?