Much has been written about using VNC with a headless RaspberryPi, but I seem to struggle with some of the suggested methods.
I also generally prefer to use the VNC server "x11vnc", as I like to view the same session as one open by a local user.
So here are my notes...
Install x11vnc, either using Synaptic or simply from a terminal like this:-
sudo apt-get install x11vnc
Create an auto-launcher by writing a text file with these lines:-
Exec=x11vnc -forever -display :0
...and save the file as x11VNC.desktop in this location: /home/pi/.config/autostart/
Note: the file name extension ".desktop" is important, otherwise this launcher will not appear in "Desktop Session Settings" list. In a rather Windows Explorer like fashion, the LXDE file manager (pcManFM) does not show the .desktop extension, but if you use "ls" in terminal you can confirm that the file name & extension are correct.
Reboot the Pi and then go to:-
start menu > Preferences > Desktop Session Settings
...and enable x11VNC
Note: I had a frustrating issue on one RaspberryPi where the x11VNC option did not show up in Desktop Session Settings list. This turned out to be because I had a backup of x11VNC.desktop file which was auto created by my editor (in this case gEdit). It seems that with both x11VNC.desktop and x11VNC.desktop~ files in the autostart folder, LXSession was getting confused. Deleting the backup (~) file seems to fix it.
So now, booting the Pi will automatically start the x11vnc server.
The VNC Client
To VNC into the RaspberryPi from my Lubuntu laptop I use vncviewer by typing into a terminal:-
...where the IP number is obviously the one allocated to the Pi.
Great, but there are a couple of problems. First of all, the VNC image on my laptop is a bit small. I'd quite like it to fill the screen on my laptop.
Secondly, it only shows a small part of the RaspberryPi desktop. There is something terribly wrong with the resolution.
The image size can be increased by editing the VNC launcher on the RaspberryPi. As the resolution on my laptop is 1366 x 768, I need to specify this with the "geometry" option.
Exec=x11vnc -forever -geometry 1366x768 -display :0
For the second problem, the RaspberryPi /boot/config.txt file must be edited (as root) to include:-
Now the VNC image is more useful...
...and the image can be switched to full-screen from a pop-up menu by pressing F8, so that the local task-bar is hidden by the remote (RaspberryPi) task-bar.