X11vnc
x11vnc is a VNC server which mirrors the current on the X11 display rather than creating a separate X11 display such as Xvnc. This is useful for remote control / desktop purposes.
Starting x11vnc
The most basic usage is to just run x11vnc on a console. The VNC port number will be printed after it has started.
A server like this will be wide open. To put a password on this server, run x11vnc -storepasswd which will help you generate a password file in $HOME/.vnc/passwd
To start x11vnc with a password, pass in -rfbauth $HOME/.vnc/passwd.
With systemd
To run x11vnc for a specific user when they log in, create the following systemd service file:
$HOME/.config/systemd/user/x11vnc.service
[Unit]
Description=start x11vnc
[Service]
ExecStart=/usr/bin/x11vnc -noncache -forever -loop -noxdamage -repeat -rfbauth /home/leo/.vncpasswd
[Install]
WantedBy=default.target
Enable and start the service as a user with:
$ systemctl --user enable x11vnc.service
$ systemctl --user start x11vnc.service
$ systemctl --user status x11vnc.service