Accessing Vmware guest OS behind NAT from another computer

Sometimes you have to do things that make sense only to you. And by no way approved by the software manufacturer.
I needed to get access to Vmware Guest OS, behind Vmware NAT interface from another computer.


It’s possible to “map” Guest OS TCP/UDP port to the Host OS port, but only to the Loopback interface (127.0.0.1) so you can access Guest OS port only from the Host OS itself, not from another computer.

Here is how it could be done (quick and dirty as usual):

  1. Use Vmware Virtual Network Editor to create NAT reverse port mapping (from Host OS to Guest OS).  Click on VmNet8 marked as NAT in the External connection column. Press “NAT settings” button,  In the new dialog window, right under “Port forwarding” list, press “Add” button. It’s worth to mention that you need to know your Guest OS IP address. For simplicity sake let’s assume it’s 192.168.8.3. We Want to map Guest OS port 22 (ssh) to Host OS port 5022.
    Virtual Network Editor

    Virtual Network Editor

    “OK” your way out of it. Start Guest OS. Use ssh client to connect to 127.0.0.1 port 5022. It works, right?

  2. Now to get to this port from outside I’m using Rinetd – very well known daemon that does TCP port remapping. There is win32 version available on the developer site, but I prefer this slightly patched verstion with the only difference that it looks for the config file in the current directory (for the paranoid out there patched source is also available from the same site). Assuming that my PC IP address is 192.168.1.4, here is how I am starting rinetd.
    Rinetd TCP port redirector

    Rinetd TCP port redirector

    Now accessing port 5022 on IP 192.168.1.4 will send you right into the Guest OS port 22.

    I will explain why I needed it in one of the later posts.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">