Debian/Ubuntu Remote desktop – TightVNC & LXDE

So you want the most (could be wrong 😀 ) lightweight X remote system for your Debian – Ubuntu server.
Read on for Light desktop installation on Debian and remote control with TightVnc.

Update and upgrade the system
lol@rofl:~# apt-get update
lol@rofl:~# apt-get upgrade

Install X, LXDE  and VNC
lol@rofl:~# apt-get install xorg lxde-core tightvncserver

It will probably install some 200mb worth of packages on your hard drive, but nowadays that’s hardly a problem with Terra sized drives.
So answer yes when asked 🙂

Initialize the tightvnc server to create a new config file
lol@rofl:~# tightvncserver :1

You are then prompted for a new password in order to access your remote desktop.
Repeat your password and and don’t worry when (and if) you see a :
–Warning: password truncated to the length of 8–
VNC like servers truncate the hardcore password you supply it with to the first 8 characters you enter
VNC uses a DES-encrypted challenge-response scheme, where the password is limited by 8 characters!

Answer no when prompted for a view only password, unless you want such an option

Kill the VNC
lol@rofl:~# tightvncserver -kill :1

# Edit config file to start session with LXDE:
lol@rofl:~# vi ~/.vnc/xstartup

# Add this at the bottom of the file:
lxterminal &
/usr/bin/lxsession -s LXDE &

# Restart VNC
lol@rofl:~# tightvncserver :1

Install chromium if you don’t already have it
lol@rofl:~# apt-get install chromium-browser

Your browser is now ready!

Take good note that the following command
lol@rofl:~# tightvncserver :1
Does actually allow the VNC daemon to listen to port 5901.
All traffic is unencrypted, except for the session password, which is a no – no (unless its the laptop on your basement with no outside access.

So in order to run securelly we shall employ the old faithful shh tunnelling

Start the VNC with listening only to localhost connections (eg. from the server inside only)
lol@rofl:~# tightvncserver -localhost :1

On your local machine open a tunnel while forwarding the port 5901 port at the same time
lol@local-rofl:~# ssh -f -N -L 5901:localhost:5901 [email protected]

Now on your local VNC client you invoke the connection to your newly created remote desktop, supply the password and Voilla you are in 😀
[email protected]:5901

Have a pick on your system default “apps”
lol@rofl:~# update-alternatives --get-selections

if you want to run root (commando mode) ont he interwebs here is how (at your own risk, you have been warned)

lol@rofl:~# chromium –user-data-dir %U
or update your short cut to include the –user-data-dir %U directive

What if, for some hideous reason you want to use your mobile or some other evil contraption to view your remote desktop.
You can change the the VNC resolution to match that of you device by issuing the following command
lol@rofl:~# vncserver -geometry 800×600

Resources :
TightNVC FAQ –
How to port forward using PUTTY  –

That’s all Folks!