How can I remotely connect to VM outside of Internal Network without connecting to Host Machine?

5,279

In order for the described scenario to work, the Guest machine must listen for remote desktop connections on a different port than the host does, unless you use bridged networking. To set the RDP server to listen to 3390, set the following registery key to "3390":

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

Then restart the Remote Desktop service, or reboot the machine.

Share:
5,279

Related videos on Youtube

Asynchronous
Author by

Asynchronous

Updated on September 18, 2022

Comments

  • Asynchronous
    Asynchronous over 1 year

    I am running Windows 7 in a VM: The VM was setup using Hyper-V within Windows Server 2012 R2. First, I configured the Linksys router Port Forwarding for TCP 3389 and 3390. To both IP addresses. I also created Firewall Inbound Rules for Port 3389 and 3390.

    To connect within Network, I simply enter the VM IP address or Computer Name, username and password and the connection is successful. I am also able to connect to the Host Machine out of my local Network by using the Public IP address.

    The Problem: When I attempt to access the VM, lets say at a Caribou or the Library, or any other outside Network, I am landing into the Host Machine instead of the VM.

    For example: To log into the VM outside, I used the same Public IP address, the username and password to the VM but I am landing in the Host machine with an error message that the user is invalid.

    I have also tried the following: Computer Name:3389 but not successful.

    How do I access the VM so that the connection is not going to the Host?

    • heavyd
      heavyd about 9 years
      Do you have the port forwarding setup on different ports? Are you specifying the port when you try to connect?
    • Frank Thomas
      Frank Thomas about 9 years
      is your guest connected by a Bridged network connection, or one using NAT? if bridged, point your router's port forward rules to the guests IP address, not the host. if NAT, look into how to configure a port forward rule in the HyperV NAT.
    • Asynchronous
      Asynchronous about 9 years
      I have both IP's set to port Forwarding. Host IP on 3389 and VM IP on 3390. If I do this: Public IP:3390. I get Unable to Connect To Remote PC.
    • Frank Thomas
      Frank Thomas about 9 years
      did you change the guests listener port for RDP to 3390? support.microsoft.com/kb/306759
    • Asynchronous
      Asynchronous about 9 years
      Just to clarify, am I making this modification for (listener port for RDP to 3390) on the VM? Meaning in Windows 7 which is running in the VM?
    • Asynchronous
      Asynchronous about 9 years
      Yes!! Yes!! It worked, I noticed that in the Registry, the Port was 3389 instead of 3390. This also explain why the connection was going to the host and not the guest. Changing the port and restarting the computer allowed the connection. Now I am curious: Do I really need to use Port 3389 and 3390? Can I use my own numbers? For example: 1111 and 2222? Thank you so much.
    • Frank Thomas
      Frank Thomas about 9 years
      yep, you can arbitrarily select any port you wish, though I recommend picking one between 2000-10000, so you have fewer issues with firewalls between your client and your LAN at home. glad you got it working.
    • Asynchronous
      Asynchronous about 9 years
      How do I mark this question as answered?