Raspberry Pi : setup VNC on the default display

Published by

Posted on January 15, 2017

I needed a way to connect the PI to the TV and VNC to that display from  any device . Below are the steps I took to accomplish my goal.

 

cd ~/
– sudo apt-get install x11vnc

mkdir -p .config/autostart
mkdir -p .vnc
if you wish to use a password
x11vnc -storepasswd .vnc/passwd

cd .config/autostart
echo “[Desktop Entry]” > x11vnc.desktop
echo “Encoding=UTF-8” >> x11vnc.desktop
echo “Type=Application” >> x11vnc.desktop
echo “Name=X11VNC” >> x11vnc.desktop
echo “Comment=” >> x11vnc.desktop
echo “Exec=x11vnc -forever -usepw -display :0 -ultrafilexfer” >> x11vnc.desktop
echo “StartupNotify=false” >> x11vnc.desktop
echo “Terminal=false” >> x11vnc.desktop
echo “Hidden=false” >> x11vnc.desktop

This start x11vnc when lxde starts. reboot the system
You can manually run the app ” x11vnc -forever & “