Mar
01

Tunneling RDP over SSH with the version 6 RDP Client

By Paulie

I regularly use SSH to connect to customer systems and tunnel various different sorts of traffic through it (Telnet, ODBC, RDP etc). In certain cases, I have no other method of remote access to systems other than SSH.

This has not been a problem until I recently upgraded to Windows Vista which includes remote desktop connection v6, which will not allow connections to 127.0.0.1 on any port, it complains with the error message:

“The client could not connect. You are already connected to the console of this computer. A new console session cannot be established”

Which of course is true, if I were trying to connect to 3389.

So today after spending significant effort in the last couple of months I have found a simple solution to the problem:

  • Instruct your SSH client to listen on all interfaces for connections. For command line this means adding “-g” to your connection. I am using putty so ticking the box that says “local ports accept connections from other hosts” under Connection/SSH/Tunnels will do the job.
  • Putty

  • In the remote desktop client use 127.0.0.2 as the destination host and it will then happily pass through any tunnels you have created. For example 127.0.0.2:3390
  • I realize there probably are not that many people out there using SSH to tunnel RDP, but if you are then RDP 6 has been a real pain until now.

    Categories : How To, Technical Posts

    Comments

    1. polgara370 says:

      Thank you so much! You don’t know how many hours I spent combing the internet for a solution. I had submitted the problem to our syadmin and either they were ignoring me or couldn’t figure out the problem either.

    2. Eskimo says:

      Finally something that works, TY. There was another approach like this but that gave me the idea to use L127.0.0.2:3389 which didn’t work. And the compability mode approaches were just plain non-working (as they required so many other files too).

    3. holdtotherod says:

      Thanks a bunch. I had a hard time figuring this one out as well. I originally was connecting using the old version of RDP Client (from XP) and it was working, but when I tried connection using RDP 6 I couldn’t figure out what I was doing wrong. Once I did, I looked for a solution, and yours was by far the most straight forward and easiest of the solutions. Thanks again.

    4. tb says:

      Thanks, really needed that.
      Yet another reason to hate Microsoft.

    5. Brian says:

      Thank you for this info. Yours was the first I came across with reference to localhost problems on Vista that worked.

    6. John says:

      Excellent article, the only reference I found to this issue that was understandable enough for someone new to RDC and SSH to be able to figure out.

    7. Alex says:

      Hi m8. Thx for the tip. I was going to jump out of the WINDOW ! and you saved my day. I am not using the crap in real but only in VMs and only because I have to (My job does require that !) Everyone, go get a Mac and run OSX. If you ain’t got the money, then switch to Unix/Linux and Co.

      I am really angry because of the fact that one should pay so much for the Windows and then, still waste hours of the precious life to solve such issues.

    Leave a Reply