What is the correct way to do Port Forwarding using VMWare

Viewed 35777

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?

3 Answers

I believe you actually answered your question correctly as I was following it and achieved desired outcome.

IMHO, the error: ERR_CONNECTION_REFUSED indicates that a firewall on your host OS or guest OS (your VM) or on both doesn't allow the communication through the given ports.

The easiest thing would be to try to disable firewalls on boths, your HOST and GUEST OS.

Not sure what are your OSes, but here is just a good guide for setting up firewall rules on Ubuntu

Related