Thursday 27 November 2014

Set up VNC on Linux to automatically start on system boot

What:

VNC on Ubuntu 14.04 LTS Linux

Problem:

I want to be able to connect to "display :0", access Linux console display.

Solution:

1. Change to root
sudo su -
2. Install x11vnc
apt-get install x11vnc
3. Set your vnc password
x11vnc -storepasswd
password will be stored in ~/.vnc/passwd file

4. Move password file to /etc directory
mv ~/.vnc/passwd /etc/x11vnc.pass
5. Create upstart job
vi /etc/init/x11vnc.conf
Paste below code and save x11vnc.conf file
start on login-session-start
script
x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth /var/run/lightdm/root/:0 -forever -bg -o /var/log/x11vnc.log -rfbauth /etc/x11vnc.pass -rfbport 5900 -localhost
end script
if you want to allow more than one client connection add -shared switch

No comments:

Post a Comment