Viewing one PC's desktop on another PC

There are many options you can take and many things you may have to do because of the layout of the network between the two machines. My conclusion has to be that the best option would be to look into the commercial solutions available (such as Remote Administrator), or, on WinXP, the built-in terminal services.

Meanwhile, however, I put some hours into trying to get various open-source applications configured. Here I will describe the steps I took to view my work machine's desktop from home and vice versa. It uses a secure connection and gets through work's firewall (which allows all outgoing connections).

I have assumed your two machines are far apart and therefore tried to order things accordingly. If you just want to get on with it and get it working, ignore the brown comments. This system is not ideal and hasn't been tested much. Many of the steps may have only worked for me because of certain quirks of my computer setup. These instructions will therefore probably evolve over time, please send any comments/suggestions to me.

Terminology

I'll call the computer whose desktop you want to view the work machine, and the machine doing the viewing will be the home one.

Step 1: (Home) Install VNC

Download this software package by clicking here, then selecting the Windows 9x/2000/NT/XP (x86) tickbox near the bottom left, then "Proceed to download". Choose to download the full installation. When you've downloaded it, run the .exe and accept all the install defaults.

VNC is a program that lets you view one machine's desktop on another. It's pretty simple and in fact cross-platform. It does not use a secure connection (even your password is plaintext). We will bolt security on at a later stage. It also sets up a system service waiting for people to log into your home machine to view your home desktop.

Step 2: (Home) Configure VNC

Click "Start" then "Programs" then "RealVNC" then "VNC Viewer" then "Run Listening VNC Viewer". Optionally, you could copy the shortcut you've just clicked on into your startup folder so this software always starts when you start your machine.

As these instructions stand, the connection between viewer and server (home and work) can only be made from the work end, so we must start a viewer that just waits for servers to ask it to view them. The request will then be made from your work machine.

Right-click on the VNC icon in your system tray. Select "Properties" and then type a password of your choice into the "Password" box in the top left of the dialog box.

This password is needed for viewers dialling up the server, which is what you will be when you're at working trying to connect into home.

Download this file and open it.

This sets up some extra registry entries. The secure connection works by stealing some of the ports on one machine and making them look like aliases of ports on the other. This means that VNC will actually think it's connecting each machine to itself. It normally defaults to not allowing "loopback connections" and therefore we must override that. For added security it also allows no non-loopback connections so no-one can connect without going through SSH.

Step 3: (Home) Install SSH

Follow the instructions at this link.

This installs the secure connection software. This will sit in your machine at home waiting for people to make secure connections. It is contained within a kind of hybrid Unix-style environment for a PC.

Step 4: (Home) Get machine address

Follow this link and note down the IP address of your home machine.

This assumes that your home machine has no firewall, and has a nice static IP address (or at least one that won't change before you get to work). You will type this address into your work machine to tell it where to connect.

Step 5: (Work) Install VNC

Again, download by clicking here, then selecting the Windows 9x/2000/NT/XP (x86) tickbox near the bottom left, then "Proceed to download". Choose to download the full installation. When you've downloaded it, run the .exe and accept all the install defaults.

This time you are setting up the server which will let people view this machine's desktop.

Step 6: (Work) Configure VNC

Right-click on the VNC icon in your system tray. Select "Properties" and then type a password of your choice into the "Password" box in the top left of the dialog box.

Strangely you won't ever need this password again but it won't hurt putting one in. It's needed for viewers dialling up the server, but you will be using the server to request a viewer's attention (because the request must move in the work->home direction).

Download this file and open it.

Again, you are setting up registry entries to make sure that the machine can connect to itself (which it was it thinks it is doing when it goes through the secure system), and also that no-one else can connect into the machine.

Step 7: (Work) Install SSH

Again, follow the instructions at this link.

We are starting up the other side of the secure connection.

Step 8: (Work) Configure SSH

Download this file into c:\cygwin. Open the file for editing, and replace all the ???.???.???.??? with your home machine's IP address and the uuuuuuuu with your username at home.

This automatic script will be used by the security software on your work machine to connect to your home machine.

Open the "Cygwin Bash Shell" on your desktop or in your start menu under "Cygwin" and type "chmod 755 /startssh.txt".

That file doesn't default to being executable, so we're changing its mode.

Then download this shortcut and stick it somewhere you'll find it, like on your desktop. Double-click on that shortcut. Hopefully you will be asked for a password. Type in the password you use at home to log into your home machine (not the password you invented earlier in these instructions).

This establishes the secure connection between work and home.

Done!

Now you can connect in either of the two directions.

Connect home to work

This must unfortunately be done from work. At work, right-click on the VNC icon in your system try, select "Add New Client" and type "localhost:0". The VNC icon should invert, so it's black instead. Your home machine will now be viewing work's desktop. When you next go home, work's desktop will be available.

You typed "localhost:0" to indicate that you want to connect to the primary display of the local (i.e. work) machine. This is a strange result of the way the security software hijacks the connection between the machines. Unfortunately as it stands now you cannot start the connection from home - if you accidentally close the viewer on your home machine, you'll have to wait until you next go to work before you can start it again.

Connect work to home

This is easier, click on "Run VNC Viewer" at work in your start menu under "RealVNC". Type in "localhost:1". You will get a window showing your home machine's desktop.

You have asked for the secondary display at work, which has been wired, by SSH, to the primary display at home.

Links

See the VNC home page for more instructions on how to use the Virtual Network Client software.
Someone else's instructions on using VNC over SSH on NT.