Hi - I recently ported my x11vnc.service file from my OpenSuSE15.3 system to my new OpenSuSE15.4 system. It ran fine under 15.3 but now in the 15.4 system the x11vnc service fails to start. My x11vnc.service file is as follows - [Unit] Description=X11VNC Service After=multi-user.target [Service] Type=simple ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure RestartSec=2 User=root Group=root [Install] WantedBy=multi-user.target ------------------------------------ The x11vnc.log file shows the following - darkstar:/var/log #more x11vnc.log 17/07/2022 13:25:25 passing arg to libvncserver: -rfbauth 17/07/2022 13:25:25 passing arg to libvncserver: /etc/vncpasswd 17/07/2022 13:25:25 passing arg to libvncserver: -rfbport 17/07/2022 13:25:25 passing arg to libvncserver: 5900 17/07/2022 13:25:25 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 30003 17/07/2022 13:25:25 XOpenDisplay("") failed. 17/07/2022 13:25:25 Trying again with XAUTHLOCALHOSTNAME=localhost ... 17/07/2022 13:25:25 17/07/2022 13:25:25 *** XOpenDisplay failed. No -display or DISPLAY. 17/07/2022 13:25:25 *** Trying ":0" in 4 seconds. Press Ctrl-C to abort. 17/07/2022 13:25:25 *** 1 2 3 ------------------------------------ So what changed with x11vnc between 15.3 and 15.4 and how do I get this working again? Thanks in advance for helping me! Marc C -- *"The Truth is out there" - Spooky* *_ _ . . . . . . _ _ . _ _ _ _ . . . . _ . . . . _ _ . _ _ _ . . . . _ _ . _ . . _ . _ _ _ _ . _ . _ . _ . _ . * Computers: the final frontier. These are the voyages of the user Marc. His mission: to explore strange new hardware. To seek out new software and new applications. To boldly go where no Marc has gone before! (/This email is digitally signed and the OpenPGP electronic signature is added as an attachment. If you know how, you can use my public key to prove this email indeed came from me and has not been modified in transit. My public key, which can be used for sending encrypted email to me also, can be found at - https://keys.openpgp.org/search?q=marc@marcchamberlin.com or just ask me for it and I will send it to you as an attachment. If you don't understand all this geek speak, no worries, just ignore this explanation and ignore the OpenPGP signature key attached to this email (it will look like gibberish if you open it) and/or ask me to explain it further if you like./)
On 18.07.2022 00:55, Marc Chamberlin wrote:
Hi - I recently ported my x11vnc.service file from my OpenSuSE15.3 system to my new OpenSuSE15.4 system. It ran fine under 15.3 but now in the 15.4 system the x11vnc service fails to start. My x11vnc.service file is as follows -
[Unit] Description=X11VNC Service After=multi-user.target
[Service] Type=simple ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority
/usr/bin/x11vnc is provided by two packages - x11vnc and tigervnc-x11vnc. Which one do you have?
-forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure RestartSec=2 User=root Group=root
[Install] WantedBy=multi-user.target
------------------------------------ The x11vnc.log file shows the following -
darkstar:/var/log #more x11vnc.log 17/07/2022 13:25:25 passing arg to libvncserver: -rfbauth 17/07/2022 13:25:25 passing arg to libvncserver: /etc/vncpasswd 17/07/2022 13:25:25 passing arg to libvncserver: -rfbport 17/07/2022 13:25:25 passing arg to libvncserver: 5900 17/07/2022 13:25:25 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 30003 17/07/2022 13:25:25 XOpenDisplay("") failed. 17/07/2022 13:25:25 Trying again with XAUTHLOCALHOSTNAME=localhost ... 17/07/2022 13:25:25 17/07/2022 13:25:25 *** XOpenDisplay failed. No -display or DISPLAY. 17/07/2022 13:25:25 *** Trying ":0" in 4 seconds. Press Ctrl-C to abort. 17/07/2022 13:25:25 *** 1 2 3
------------------------------------ So what changed with x11vnc between 15.3 and 15.4 and how do I get this working again? Thanks in advance for helping me! Marc C
W dniu 17.07.2022 o 23:55, Marc Chamberlin pisze:
Hi - I recently ported my x11vnc.service file from my OpenSuSE15.3 system to my new OpenSuSE15.4 system. It ran fine under 15.3 but now in the 15.4 system the x11vnc service fails to start. My x11vnc.service file is as follows -
[Unit] Description=X11VNC Service After=multi-user.target
[Service] Type=simple ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure RestartSec=2 User=root Group=root
[Install] WantedBy=multi-user.target
------------------------------------ The x11vnc.log file shows the following -
darkstar:/var/log #more x11vnc.log 17/07/2022 13:25:25 passing arg to libvncserver: -rfbauth 17/07/2022 13:25:25 passing arg to libvncserver: /etc/vncpasswd 17/07/2022 13:25:25 passing arg to libvncserver: -rfbport 17/07/2022 13:25:25 passing arg to libvncserver: 5900 17/07/2022 13:25:25 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 30003 17/07/2022 13:25:25 XOpenDisplay("") failed. 17/07/2022 13:25:25 Trying again with XAUTHLOCALHOSTNAME=localhost ... 17/07/2022 13:25:25 17/07/2022 13:25:25 *** XOpenDisplay failed. No -display or DISPLAY. 17/07/2022 13:25:25 *** Trying ":0" in 4 seconds. Press Ctrl-C to abort. 17/07/2022 13:25:25 *** 1 2 3
------------------------------------ So what changed with x11vnc between 15.3 and 15.4 and how do I get this working again? Thanks in advance for helping me! Marc C
AFAIK ~/.Xauthority is no longer used $ systemctl --user show-environment | grep "^XAUTHORITY=" XAUTHORITY=/run/user/1000/xauth_GJhCTl Maybe you'll get better results with running it as "User Unit" (see "man systemd.unit").
On 18.07.2022 09:45, Adam Mizerski wrote:
AFAIK ~/.Xauthority is no longer used
$ systemctl --user show-environment | grep "^XAUTHORITY=" XAUTHORITY=/run/user/1000/xauth_GJhCTl
It depends on display manager. But yes, both GDM and SDDM are using random volatile location for each session (as well as Xwayland under GNOME).
Maybe you'll get better results with running it as "User Unit" (see "man systemd.unit").
Marc Chamberlin wrote:
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority
As others wrote, the auth is no longer used/valid. Most systems now use a random generated /run/user/<UID>/xauth_* And the bad thing is, there are AFAIK) no API ways to find that location, which breaks things like x11vnc_ssh (which is what I mostly use). Not sure what the proper way is there. What I do is wrap it in a script #!/bin/bash XA=$(ssh $1 'ls -t /run/user/$UID/xauth_*|head -1') exec x11vnc_ssh $1 "-auth $XA"
On 18.07.2022 13:17, Peter Suetterlin wrote:
Marc Chamberlin wrote:
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority
As others wrote, the auth is no longer used/valid. Most systems now use a random generated /run/user/<UID>/xauth_*
And the bad thing is, there are AFAIK) no API ways to find that location, which breaks things like x11vnc_ssh (which is what I mostly use).
Not sure what the proper way is there.
There is Xorg vnc module, you could give it a try.
What I do is wrap it in a script
#!/bin/bash
XA=$(ssh $1 'ls -t /run/user/$UID/xauth_*|head -1') exec x11vnc_ssh $1 "-auth $XA"
On 18.07.2022 13:58, Andrei Borzenkov wrote:
On 18.07.2022 13:17, Peter Suetterlin wrote:
Marc Chamberlin wrote:
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority
As others wrote, the auth is no longer used/valid. Most systems now use a random generated /run/user/<UID>/xauth_*
And the bad thing is, there are AFAIK) no API ways to find that location, which breaks things like x11vnc_ssh (which is what I mostly use).
Not sure what the proper way is there.
There is Xorg vnc module, you could give it a try.
bor@10:~> rpm -ql xorg-x11-Xvnc-module /usr/lib64/xorg/modules/extensions/libvnc.so /usr/share/X11/xorg.conf.d/10-libvnc.conf bor@10:~> cat /etc/X11/xorg.conf.d/10-libvnc-local.conf # This file contains configuration of libvnc.so module # # To get libvnc.so module working, do this: # 1. run "vncpasswd" as root user # 2. uncomment configuration lines below # # Please note you can specify any option which Xvnc accepts. # Refer to `Xvnc -help` output for detailed list of options. Section "Module" Load "vnc" EndSection Section "Screen" Identifier "Screen0" Option "SecurityTypes" "None" EndSection bor@10:~> Of course this is just a test system, so no authentication. It mirrors X server content over VNC. Including display manager chooser/login screen.
On 7/18/22 03:17, Peter Suetterlin wrote:
Marc Chamberlin wrote:
ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority As others wrote, the auth is no longer used/valid. Most systems now use a random generated /run/user/<UID>/xauth_*
And the bad thing is, there are AFAIK) no API ways to find that location, which breaks things like x11vnc_ssh (which is what I mostly use).
Not sure what the proper way is there. What I do is wrap it in a script
#!/bin/bash
XA=$(ssh $1 'ls -t /run/user/$UID/xauth_*|head -1') exec x11vnc_ssh $1 "-auth $XA"
Thanks Peter, (a bit belated I know, been on vacation) I think you got me over the hump with a happy x11vnc service. I will show you what I did and you or anyone else can critique it if you like.... My x11vnc.service file now looks like this -
[Unit] Description=X11VNC Service After=multi-user.target
[Service] Type=simple ExecStart=/srv/x11vnc/ExecStartx11vnc.sh # ExecStart=/usr/bin/x11vnc -display :0 -auth /home/marc/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared ExecStop=/usr/bin/x11vnc -R stop Restart=on-failure RestartSec=2 User=root Group=root
[Install] WantedBy=multi-user.target
As you can see I created a script - /srv/x11vnc/ExecStartx11vnc.sh which contains the following -
#!/bin/bash
XA=$(ls -t /run/user/1000/xauth_*|head -1) exec /usr/bin/x11vnc -display :0 -auth $XA -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared
This isn't a generic solution by any means, but with a bit of thought I am sure it could be made into one. Probably have to figure out how to select a user and map that into a UID and then pass the user name to the x11vnc.service file, convert it to a UID and pass that to the script. At least this reply might serve as a roadmap for anyone who wants to set up an x11vnc service on OpenSuSE 15.4 and beyond. Your help is much appreciated! Marc C. -- --... ...-- .----. ... -.. . .-- .- --... .--. -..- .-- -- .- .-. -.-. <b>Computers: the final frontier. These are the voyages of the user Marc.<br> His mission: to explore strange new hardware. To seek out new software and new applications.<br> To boldly go where no Marc has gone before!<br></b>
On 26.07.2022 02:01, Marc Chamberlin wrote: ...
#!/bin/bash
XA=$(ls -t /run/user/1000/xauth_*|head -1) exec /usr/bin/x11vnc -display :0 -auth $XA -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared
This isn't a generic solution by any means,
This script can only be run successfully after you have already logged in, which means making this script global system-wide service is useless - just start x11vnc as part of user session (as systemd user service or simply as startup script in your DE). It will get the correct $DISPLAY, $XAUTHORITY etc automatically. There is absolutely no need to run x11vnc as root and it will terminate anyway as soon as X server is stopped (if you log out). But if you insist on over-complicating it ...
Since I use sddm on Leap 15.3, I use this: -display :0 -auth /run/sddm/{*-*-*-*-*} Then I can log in or just get the current login. Whatever is on the display. On Tue, Jul 26, 2022 at 6:54 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On 26.07.2022 02:01, Marc Chamberlin wrote: ...
#!/bin/bash
XA=$(ls -t /run/user/1000/xauth_*|head -1) exec /usr/bin/x11vnc -display :0 -auth $XA -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared
This isn't a generic solution by any means,
This script can only be run successfully after you have already logged in, which means making this script global system-wide service is useless - just start x11vnc as part of user session (as systemd user service or simply as startup script in your DE). It will get the correct $DISPLAY, $XAUTHORITY etc automatically. There is absolutely no need to run x11vnc as root and it will terminate anyway as soon as X server is stopped (if you log out).
But if you insist on over-complicating it ...
-- Roger Oberholtzer
I should add that I run /usr/bin/x11vnc via a script (to get the auth info) that is managed by xinetd. Works great. hydra:/etc/xinetd.d # cat x11vncservice service x11vncservice { socket_type = stream protocol = tcp wait = no user = root server = /usr/local/bin/x11vnc-wrapper server_args = "" port = 5900 type = UNLISTED } hydra:/etc/xinetd.d # cat /usr/local/bin/x11vnc-wrapper #!/usr/bin/sh exec /usr/bin/x11vnc -inetd -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -display :0 -auth /run/sddm/{*-*-*-*-*} -env FD_XDM=1 -shared -forever On Tue, Jul 26, 2022 at 11:32 AM Roger Oberholtzer <roger.oberholtzer@gmail.com> wrote:
Since I use sddm on Leap 15.3, I use this:
-display :0 -auth /run/sddm/{*-*-*-*-*}
Then I can log in or just get the current login. Whatever is on the display.
On Tue, Jul 26, 2022 at 6:54 AM Andrei Borzenkov <arvidjaar@gmail.com> wrote:
On 26.07.2022 02:01, Marc Chamberlin wrote: ...
#!/bin/bash
XA=$(ls -t /run/user/1000/xauth_*|head -1) exec /usr/bin/x11vnc -display :0 -auth $XA -forever -loop -noxdamage -repeat -rfbauth /etc/vncpasswd -o /var/log/x11vnc.log -rfbport 5900 -noipv6 -shared
This isn't a generic solution by any means,
This script can only be run successfully after you have already logged in, which means making this script global system-wide service is useless - just start x11vnc as part of user session (as systemd user service or simply as startup script in your DE). It will get the correct $DISPLAY, $XAUTHORITY etc automatically. There is absolutely no need to run x11vnc as root and it will terminate anyway as soon as X server is stopped (if you log out).
But if you insist on over-complicating it ...
-- Roger Oberholtzer
-- Roger Oberholtzer
participants (5)
-
Adam Mizerski
-
Andrei Borzenkov
-
Marc Chamberlin
-
Peter Suetterlin
-
Roger Oberholtzer