May 24th, 2008
I'm still reloading things back onto my home PC after my recent Windows reinstall. It's going to a while yet before it's all back on there. The most recent thing I had to get working again was getting a Remote Desktop session to machines at work.
Setting up Windows Remote Desktop to allow you to use another machine on the same local network is very straightforward. Getting a Remote Desktop connection to a PC on a private external network is a little more tricky. I use PuTTY to SSH to the gateway machine at work.

Part of the PuTTY session is a series tunnels from ports on my local machine to ports on machines on the remote desktop. One of these is a mapping from the localhost port 3389 to port 3389 on a machine at work. Port 3389 is the port used by Remote Desktop, so this tunnel should mean that, once PuTTY has connected me to the external network, I can Remote Desktop to localhost and I will, as if by magic, get the login prompt for the remote machine.
However, having copied back into PuTTY the sessions from my previous Windows installation*, when I connected to the remote machine and then did a Remote Desktop to localhost I got 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."
The reason for this, it turns out, is that Remote Desktop knows it shouldn't allow circular connections: from this computer to this computer. So it rejects attempts to connect to 127.0.0.1. Now, as localhost resolves to 127.0.0.1, this gets rejected also.
However, on Windows, all other IP addresses in the 127.x.x.x range also represent the local machine, and Remote Desktop does not block these addresses. So this allows you to map port 3389 on one of these addresses (e.g. 127.0.0.2 or 127.254.254.254) to port 3389 on a remote PC and then you can specify that address in the Remote Desktop login window.
Note: Although the Source port field is clearly intended just for a port number, you can also put an IP address in there, followed by a port number - for example, 127.254.254.254:3389 - and then the remote IP address or hostname, followed by the port number, in the Destination field.
* The PuTTY sessions for each Windows user are stored in the Windows registry in:
HKEY_USERS > [GUID for user] > Software > SimonTatham
Before reinstalling Windows I'd exported the whole registry to a .reg file on my network drive. To put the details into the new registry all I had to do was open up the .reg file in a text editor, save it with a name like putty.reg on the desktop of the target PC, delete everything in the file after the first line up to the start of the HKEY_USERS > [GUID for user] > Software > SimonTatham section and everything after that section, then save it again. Then you just need to right-click the icon on the desktop and choose Merge.
Potentially similar posts