all command under root user
Pre-Install
- Set Boot Option to "Desktop"
root@raspberrypi:~# raspi-config
- Update Raspbian
root@raspberrypi:~# apt-get update
root@raspberrypi:~# apt-get upgrade
root@raspberrypi:~# apt-get dist-upgrade
Installation X11 VNC Server
1. Check & install x11vnc
root@raspberrypi:~# apt-cache search x11vnc
x11vnc - VNC server to allow remote access to an existing X session
root@raspberrypi:~# apt-get install x11vnc
2. Set VNC Sever password
root@raspberrypi:~# x11vnc -storepasswd raspberry /etc/x11vnc.pass
stored passwd in file: /etc/x11vnc.pass
3. Service script for startup
root@raspberrypi:~# vi /lib/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -forever -loop -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log
[Install]
WantedBy=multi-user.target
4.Add Startup Script to Service
root@raspberrypi:~# systemctl daemon-reload
root@raspberrypi:~# systemctl enable x11vnc.service
Created symlink from /etc/systemd/system/multi-user.target.wants/x11vnc.service to /lib/systemd/system/x11vnc.service.
Start Server and Test from VNC viewer
root@raspberrypi:~# systemctl start x11vnc.service
5.Check status of VNC Service
root@raspberrypi:~# systemctl status x11vnc.service
● x11vnc.service - Start x11vnc at startup.
Loaded: loaded (/lib/systemd/system/x11vnc.service; enabled)
Active: active (running) since Tue 2016-05-10 15:31:58 ICT; 8s ago
Main PID: 1120 (x11vnc)
CGroup: /system.slice/x11vnc.service
├─1120 /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -forever -loop -noxrecord -noxfixes -noxdamage -...
└─1121 /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -forever -loop -noxrecord -noxfixes -noxdamage -...
May 10 15:31:58 raspberrypi systemd[1]: Started Start x11vnc at startup..
May 10 15:31:58 raspberrypi x11vnc[1120]: --- x11vnc loop: 1 ---
May 10 15:31:59 raspberrypi x11vnc[1120]: --- x11vnc loop: waiting for: 1121
May 10 15:31:59 raspberrypi x11vnc[1120]: disabling -bg in -loop mode
May 10 15:32:03 raspberrypi x11vnc[1120]: PORT=5900