What is the correct way to do Port Forwarding using VMWare

Fallenreaper picture Fallenreaper · Mar 15, 2016 · Viewed 31.8k times · Source

I have created a VM which has a server running at localhost:8675/ which I had wanted to connect to my host machine at the same port for ease of understanding. I was following these to documents for information:

When I was in my VMWare Workstation, I clicked on my VM, then did: Edit > Virtual Network Editor. After that, enabled Change Settings which relaunched the window in admin mode. I clicked on the Row with Type NAT and external Connection NAT and in the VMNet Information with the NAT radio button pressed, I clicked the NAT Settings Button.

I said: Add... and then did:

Host: 8675
Type: TCP
VMIP: 127.0.0.1:8675
Description:  Port Foward of 8675 from Host to VM.

It looks like everything is good. I say Ok and Apply in succession. It looked like it shut down nat and restarted some services.

I confirmed in the VM, the 127.0.0.1:8675 is correct. In the HOST, I tried to go to: http://localhost:8675/ and it says: ERR_CONNECTION_REFUSED

I figured this was all I needed to do.

I was looking up some additional information and noticed that some people have had to configure firewalls. I wasnt sure if i needed to though, as I was thinking that the HOST and VM are all in 1 actual machine, it might be entirely self contained.

Is there a critical task I am missing?

Answer

Fallenreaper picture Fallenreaper · Mar 15, 2016

I saw this post: https://superuser.com/questions/571196/port-forwarding-to-a-vmware-workstation-virtual-machine which told me to just adjust it to bridged and use it that way. Does this solve the issue of connecting HOST / VM Issue.

I don't want to say this is the correct answer though as the question itself is particular to NAT, but this is a valid alternative answer that does work.

This is solves the base issue at hand, but not the question.