How to setup VNC server for remote desktop in Ubuntu 11.10 Oneiric

Install VNC server in Ubuntu 11.10 Oneiric for remote-desktop is very easy. Here are the steps to install :


sudo apt-get install x11vnc
sudo x11vnc -storepasswd yourpasswordhere /etc/x11vnc.pass
sudo chmod 744 /etc/x11vnc.pass

Now you should edit your lightdm :

sudo vim /etc/lightdm/lightdm.conf


greeter-setup-script=/usr/bin/x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /tmp/x11vnc.log

To run manually :

sudo x11vnc -rfbauth /etc/x11vnc.pass -o /var/log/x11vnc.log -forever -bg -rfbport 5900 -nomodtweak

or


sudo x11vnc -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /tmp/x11vnc.log

Happy remote desktop! :)