1

Using Debian 9 + X11VNC + KDE5

I have a script in /usr/share/sddm/scripts/Xsetup that runs x11vnc before sddm starts, so I can access the launcher with VNC.

My problem is that the VNC connection is killed when I launch KDE; therefore, I have to start the VNC client again to reconnect and access KDE with VNC. I guess the magic cookie changed and that this causes the problem. This is why I have another script in /etc/systemd/system/x11vnc.service that is launched when KDE starts.

Do you have any idea how I could keep the magic cookie identical for sddm and kde, preferably in one script?

In the following scripts the magic cookie is found with -auth $(find /var/run/sddm/ -type f).

First script:

/usr/bin/x11vnc -xkb -noxrecord -shared -geometry 1024x768 -ncache -noncache -forever -rfbport 5974 -noipv6 -many -display :0  -auth $(find /var/run/sddm/ -type f) -rfbauth /root/.vnc/passwd -o /root/.vnc/x11vnc.log -repeat -dbg -loop

Second script (service):

[Unit]
Description=x11vnc
Requires=display-manager.service
After=multi-user.target
After=systemd-user-sessions.service
After=display-manager.service


[Service]
Type=simple
Restart=on-failure
RestartSec=5
User=root

ExecStart=/bin/bash -c "/usr/bin/x11vnc -xkb -noxrecord -shared -geometry 1024x768 -ncache -noncache -forever -rfbport 5974 -noipv6 -many -display :0  -auth $(find /var/run/sddm/ -type f) -rfbauth /root/.vnc/passwd -o /root/.vnc/x11vnc.log -repeat -dbg -loop"

#aide liste options: http://karlrunge.com/x11vnc/x11vnc_opts.html

[Install]
WantedBy=multi-user.target

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.