Skip to content

Instantly share code, notes, and snippets.

@farinspace
Last active November 6, 2021 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/f5b0c9ca6b70334bfe4749f8346db8d9 to your computer and use it in GitHub Desktop.
Save farinspace/f5b0c9ca6b70334bfe4749f8346db8d9 to your computer and use it in GitHub Desktop.
x11vnc setup solution, Ubuntu 18.04 LTS

Make and Make install

See x11vnc stack smashing detected solution

Recommended version: x11vnc: 0.9.14 lastmod: 2013-11-21

.Xauthority

Set desktop to auto login and prevent screen locking .. else you will need to deal with Xauth

Test run x11vnc

/usr/local/bin/x11vnc -forever -display :0

Create a password

x11vnc -storepasswd

or use -localhost when starting service and use an ssh tunnel instead

Setup service at /lib/systemd/system/x11vnc.service

sudo systemctl daemon-reload
sudo systemctl enable x11vnc
sudo systemctl start x11vnc
[Unit]
Description=x11vnc
Requires=display-manager.service
After=display-manager.service
[Service]
ExecStart=/usr/bin/x11vnc -forever -display :0 -rfbauth /home/[USERNAME]/.vnc/passwd
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target
@likaci
Copy link

likaci commented Mar 19, 2020

with default gnome desktop
/lib/systemd/system/x11vnc.service

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -forever -display :0 -rfbauth /etc/x11vnc.pass -auth /run/user/1000/gdm/Xauthority

[Install]
WantedBy=multi-user.target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment