- Set VNC password:
sudo x11vnc -storepasswd [YOUR VNC PASSWORD] /etc/x11vnc.passwd
- Install Systemd Unit File
sudo cp [path to]/vnc.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vnc.service
[Unit] | |
Description=VNC Server | |
After=multi-user.target network.target | |
[Service] | |
Restart=always | |
# Replace this with x0vncserver from TigerVNC in Ubuntu 18.04. | |
# Set password by running `sudo x11vnc -storepasswd [PASSWORD] /etc/x11vnc.passwd` | |
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.passwd -rfbport 5900 -shared | |
[Install] | |
WantedBy=multi-user.target |