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
[email protected]:~# apt-get update
[email protected]:~# apt-get upgrade

Install X, LXDE  and VNC
[email protected]:~# 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
[email protected]:~# 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
[email protected]:~# tightvncserver -kill :1

# Edit config file to start session with LXDE:
[email protected]:~# vi ~/.vnc/xstartup

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

# Restart VNC
[email protected]:~# tightvncserver :1

Install chromium if you don’t already have it
[email protected]:~# apt-get install chromium-browser

Your browser is now ready!

Take good note that the following command
[email protected]:~# 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)
[email protected]:~# tightvncserver -localhost :1

On your local machine open a tunnel while forwarding the port 5901 port at the same time
[email protected]:~# 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”
[email protected]:~# 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)

[email protected]:~# 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
[email protected]:~# vncserver -geometry 800×600

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

That’s all Folks!