Ref:http://vandorp.biz/2012/01/installing-a-lightweight-lxdevnc-desktop-environment-on-your-ubuntudebian-vps/#.VyCPOHVSuko
Suppose that, you have installed lxde environment. (lxde, lxde-common, lxde-core, lxde-icon-theme)
Step 1, install tightvncserver
aptitude install tightvncserver
Step 2, Start VNC to create config file
tightvncserver :1
Step 3 , Then stop VNC
tightvncserver -kill :1
Step 4, Edit config file to start session with LXDE:
vim ~/.vnc/xstartup (该文件可以删除,下次运行tightvncserver :1时,系统会自动给创建一个标准的这样的文件。但是如果该文件存在,下次运行tightvncserver :1时,该命令会直接运行该文件里的脚本。)
Step 5, Add this at the bottom of the file:
lxterminal &
/usr/bin/lxsession -s LXDE &
Step6, Restart VNC
tightvncserver :1
Notes:
If want to use xfce4 not lxde, you only need to modify step 5 as following(Add this at the bottom of the file:):
xfce4-session
x-sesion-manager &
xfdesktop &
xfce4-panel &
xfce4-menu-plugin &
xfsettingsd &
xfconfd &
xfwm4 &
===========================
Client:
how to connect this vnc server:
For windows:
run "mstsc" --> input IP ---> Module: vnc-any , IP is your vnc server ip, port : 5901, ---> Success!
For linux:
$ remote-viewer vnc://$IP:5901