Created
March 14, 2011 15:22
-
-
Save jmwhittaker/869300 to your computer and use it in GitHub Desktop.
Get localhost working in VMWare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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).