Port Forwarding to a VMware Workstation Virtual Machine

Actually the proper solution is forwarding port to guest, but not reconfiguring whole network.

You need to add port to vmware config file nat.conf

[incomingtcp]
#<external port number> = <VM's IP address>:<VM's port number>*
#(this maps guest port 80 to host port 81)
81 = 192.168.100.1:80

As discussed in Root Access chat:

  1. You don't need to do port forwarding. Just use bridging to make your guest ask for an IP address on the router's own subnet, so the guest will have an IP like 192.168.2.178 (for example). It is recommended that you use bridging instead of trying to figure out how to convince VMware's NAT adapter to do port forwarding.

  2. VMware Workstation 8 Manual page 144 (at the bottom) and the next couple of pages describe in detail how to set up bridging.

  3. General idea is to use the Virtual Network Editor to change your connection type to bridged instead of NAT, and make sure that the adapter you edit is being mapped into the VM in the VM's settings pane. That's it -- if everything is set up properly on the host side, your guest will get an IP on the router.


On Windows, you can access the Virtual Network Editor (it's on the start menu). From there you can select the NAT interface (VMnet8), click "NAT settings", and get to the point where you can set up a port forward to your VM. It works similarly to the NAT port forwarding setup on a typical router.

Bridge mode is an easy workaround but I'm in an environment where we don't want anyone attaching VMs to the network willy-nilly. NAT makes more sense to keep things isolated.