Saturday, November 17, 2007

Remote Desktop to your home Linux PC via tightVNC

TightVNC is a free remote control software package derived from the popular VNC software. Download and install in the Linux PC here. It works in a client server manner where the server is the Linux home PC and the client is the PC from where you want to connect to the server to get the desktop of it. It's insecure as it doesn't contain any encryption apart from the initial user acknowledgment password. Hence, to make it secure we have to use use SSH tunneling. More info here and here. If the home server is firewalled or connected to the outside world via a router, don't forget to enable port forwarding.

In the snapshot above, all connection to port 22 on the router is forwarded to the IP address of the server.
To connect from the client PC, we have to connect to the external IP address of the router. Check your router IP here. The next step is to download putty and vncviewer client from here and here. These are the executables that you want to run from the client PC, and no installation is needed at all. Run Putty with tunneling, and forward client port e.g. 5901 to server port. Next, run the vncviewer client. Sample run would be like below:

Note: ssh tunneling makes the implementation rather slow, as it requires encryption and decryption, thereby bandwidth conservation is required. For example in the server I would run with the command : vncserver -geometry 800x600 depth 16 :01
and ~/.vnc/xstartup would look like below (it's the default actually, note the twm window manager is chosen):
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

No comments: