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 purposes. It may also be used as a remote desktop solution, but keep in mind that x11vnc will only display the desktop and does not support audio.
Usage[edit | edit source]
x11vnc can be started by just running the x11vnc binary. There are a few additional files that you should be aware of:
$HOME/.vnc/passwd
should contain your VNC password generated usingx11vnc -storepasswd
and enabled with the-rfbauth $filename
option.~/.x11vncrc
is the x11vnc rc file which contains should contain all available options as well its default values.~/.x11vnc.log.*
should be the log file for your VNC session (can be changed with the -logfile option)
Configuration[edit | edit source]
You can configure x11vnc by editing the ~/.x11vncrc
file. Here's my configuration:
-bg # default: off
-defer 10 # default: 20
-forever # default: off
-logfile /home/leo/.x11vnc.log.hostname:5900 # default: ""
-ncache # default: on
-repeat
-overlay_nocursor # default: off
-nevershared
-wait 10 # default: 20
-noxdamage
-xkb # default: off
-shared
The options in the RC file can be overridden by passing its option to x11vnc when invoking the command. For example, I can run x11vnc -rfbauth $HOME/.vnc/passwd
to override whatever value was defined in the .x11vncrc
file.
Starting x11vnc[edit | edit source]
The most basic usage is to just run x11vnc
on a console. The VNC port number will be printed after it has started.
Starting with systemd[edit | edit source]
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
Troubleshooting[edit | edit source]
Multiple connections are not working[edit | edit source]
When using X11vnc with Guacamole, multiple connections to the same VNC session isn't working. Subsequent connections render a "The remote desktop server is currently unavailable. If the problem persists, please notify your system administrator
" error message even though the VNC connection on Guacamole's configuration allow sfor multiple connections.
According to the VNC logs, the second connection is getting refused:
24/01/2023 17:11:10 rfbProcessClientSecurityType: executing handler for type 2
24/01/2023 17:11:10 -dontdisconnect: Not shared & existing client
24/01/2023 17:11:10 refusing new client 10.1.2.11
To fix this, edit the .x11vncrc file and add a -shared
option.