Wednesday, October 22, 2014

Installing LXDE+VNC desktop environment on your Ubuntu/Debian

Configuring TightVNC
  • Make sure Debian is the latest and greatest
apt-get update
apt-get upgrade
apt-get dist-upgrade
  • Install X, LXDE, VPN programs
apt-get install xorg lxde-core lxde-icon-theme tightvncserver
  • Start VNC to create config file (this command it show prompt for input new password vnc)
tightvncserver :1
  • Then stop VNC
tightvncserver -kill :1
  • Edit config file to start session with LXDE:
nano ~/.vnc/xstartup
  • Add this at the bottom of the file:
lxterminal & /usr/bin/lxsession -s LXDE &
  • If we want to change password again for vnc remote with this command
  • Restart VNC
tightvncserver :1
  • You then connect using the VNC viewer of your choice on your local computer. I use the "VNC Free Edition Viewer for Windows Stand-Alone Viewer" at: Configure the viewer to access your VPS at:
Run tightvncserver at startup
nano /etc/init.d/tightvncserver
  • add content :
# Provides: tightvncserver
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop tightvncserver
# More details see:
### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER=’
### End customization required
eval cd ~$USER
case “$1″ in
su $USER -c ‘/usr/bin/tightvncserver :1′
echo “Starting TightVNC server for $USER “
pkill Xtightvnc
echo “Tightvncserver stopped”
echo “Usage: /etc/init.d/tightvncserver {start|stop}”
exit 1
exit 0
  • และเพิ่มให้เค้ารันตอนบูตระบบด้วยคำสั่งประมาณนี้
sudo chmod 775 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
  • Now next time you boot it will automatically runs tighvncserver
Update: To run application in LXDE as startup app, copy your application.desktop file (usually its in your desktop, otherwise make one by going to menu and right click on application and “add to desktop”) to [user]/.config/autostart
Tunnelling through SSH (make sure tunneling is allowed in ssh config) 
ssh -l user -p [ssh port usually 22] -L5901:localhost:5901 serverIp 
Example (in client terminal) :  
ssh -l root -p 22 -L5901:localhost:5901
goto vnc client and put localhost:5901

No comments:

Post a Comment

Popular Posts