Skip to content

Instantly share code, notes, and snippets.

@jmwhittaker
Created March 14, 2011 15:22
Show Gist options
  • Star 31 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmwhittaker/869300 to your computer and use it in GitHub Desktop.
Save jmwhittaker/869300 to your computer and use it in GitHub Desktop.
Get localhost working in VMWare
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.
@mhulse
Copy link

mhulse commented Jan 18, 2021

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