12

How do I forward ports from my host machine to the virtualized machine when I'm using NAT to share my network connection? I found some instructions for earlier versions of VMWare, but I don't see the files they mention in the same location in my installation.

1

2 Answers 2

23

Okay, I found out where it's located - /Library/Preferences/VMware Fusion/vmnet8/nat.conf

So, open it up (VMWare shouldn't be running while you do this):

sudo nano /Library/Preferences/VMware\ Fusion/vmnet8/nat.conf

Go down in the file, there should be a section like:

[incomingtcp]

# Use these with care - anyone can enter into your VM through these...
# The format and example are as follows:
#<external port number> = <VM's IP address>:<VM's port number>
#35 = 172.16.126.128:22

Uncomment that last line, and edit as appropriate.

Couple of notes:

  • These instructions are for TCP port forwarding, there's a corresponding [incomingudp] section for UDP
  • If for some reason this section doesn't already exist, just add it
4
  • 2
    Looks confirmed in the official documentation: vmware.com/support/ws3/doc/ws32_network21.html Commented Nov 3, 2013 at 5:26
  • So this is a global setting that affects all virtual machines? Commented Jun 25, 2015 at 10:43
  • 2
    @SargeBorsch You specify the IP of the VM that forwarding is configured for.
    – pidge
    Commented Jun 29, 2015 at 18:52
  • 1
    and then restart vmware network: sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop; sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start Commented Nov 14, 2016 at 10:51
6

Based on the VMWare knowledge base.

The following commands can be used to update the changes without restarting Fusion 4.x and later. These can be used if you not want to relaunch Fusion, if you have other Virtual Machines running.

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

Make sure you skip the --configure step as it will reset the nat.conf file to defaults.

Source: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1026510

1
  • 2
    This isn't a complete solution in and of itself, but is a very useful addition to the other answer given. Perhaps it should be an edit to the other answer, or have the other answer's content added here (with credit, of course), to have a single answer that covers the complete steps? Commented Jun 23, 2014 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .