X Authority files not always installed or updated apparently
Hello - I am trying to grok how two X authority files get created and who/what is responsible for creating them. I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system and I use it for/via the -auth parameter of x11vnc command and the x11vnc service can be started up OK. If my script does not find the X authority file at this first location then it assumes that it is running on OpenSuSE 15.3 or earlier and looks for the X authority file at ~/.Xauthority. And again (ASSUMING my script is running on an OpenSuSE 15.3 or earlier system) if my script finds it there it passes the location of the .Xauthority file to x11vnc via the -auth parameter and the xvncserver will start up an run OK. The trouble is that on about half of my OpenSuSE 15.4 systems, the X authority file is not being created at /run/user/1000/ This causes my script to fall through to looking for the X authority file in the users home directory at ~/.Xauthority but using that for x11vnc via it's -auth parameter results in getting error messages such as this - in
23/02/2024 10:06:40 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 23287 Invalid MIT-MAGIC-COOKIE-1 keyNo protocol specified 23/02/2024 10:06:40 XOpenDisplay(":0") failed. 23/02/2024 10:06:40 Trying again with XAUTHLOCALHOSTNAME=localhost ... Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key 23/02/2024 10:06:40 *************************************** 23/02/2024 10:06:40 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. *** There may be "Xlib:" error messages above with details about the failure.
I believe the ~/.Xauthority file in my home directory may be a left-over file from when I was running previous versions of OpenSuSE? I get that feeling because if I delete the .Xauthority file (as some internet searches suggested) it is not recreated when I rebooted or log out, log back in. So I am guessing that ~/Xauthority files have been deprecated/removed from OpenSuSE 15.4 and later systems? additional info - OpenSuSE 15.4 x64 kf5-config --version Qt: 5.15.2 KDE Frameworks: 5.90.0 kf5-config: 1.0 plasmashell --version qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Crud! don't know how to solve this, maybe "plasmashell ---version" does not work over SSH? Let me know what other info is needed. Please let me know how to create the /run/user/1000/xauth_* X authority file on those systems that are not doing so and thanks as always in advance.... Marc... (please forgive me if my font size is bad, I have a horrible time getting font sizes set correctly on OpenSuSE! There are no guidelines and choosing what tool to use is just guesswork. I have set Thunderbird to send this as plain text. HTHs)
On 24.02.2024 00:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them.
Normally they are created by display manager that starts X server.
I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system and I use it for/via the -auth parameter of x11vnc command and the x11vnc service can be started up OK. If my script does not find the X authority file at
If you start x11vnc from within your desktop session you automatically get the correct environment.
this first location then it assumes that it is running on OpenSuSE 15.3 or earlier and looks for the X authority file at ~/.Xauthority. And again (ASSUMING my script is running on an OpenSuSE 15.3 or earlier system) if my script finds it there it passes the location of the .Xauthority file to x11vnc via the -auth parameter and the xvncserver will start up an run OK.
The trouble is that on about half of my OpenSuSE 15.4 systems, the X authority file is not being created at /run/user/1000/ This causes my script to fall through to looking for the X authority file in the users home directory at ~/.Xauthority but using that for x11vnc via it's -auth parameter results in getting error messages such as this - in
23/02/2024 10:06:40 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 23287 Invalid MIT-MAGIC-COOKIE-1 keyNo protocol specified 23/02/2024 10:06:40 XOpenDisplay(":0") failed. 23/02/2024 10:06:40 Trying again with XAUTHLOCALHOSTNAME=localhost ... Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key 23/02/2024 10:06:40 *************************************** 23/02/2024 10:06:40 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. *** There may be "Xlib:" error messages above with details about the failure.
I believe the ~/.Xauthority file in my home directory may be a left-over file from when I was running previous versions of OpenSuSE? I get that feeling because if I delete the .Xauthority file (as some internet searches suggested) it is not recreated when I rebooted or log out, log back in. So I am guessing that ~/Xauthority files have been deprecated/removed from OpenSuSE 15.4 and later systems?
additional info -
OpenSuSE 15.4 x64
kf5-config --version Qt: 5.15.2 KDE Frameworks: 5.90.0 kf5-config: 1.0
plasmashell --version qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Crud! don't know how to solve this, maybe "plasmashell ---version" does not work over SSH?
SSH? How SSH suddenly comes in picture? You did not say anything about doing that remotely. I guess you better take a step back and explain what you are trying to achieve, not how you think it should be done.
Thanks Andrei for your time and responses, I will, like you did, intersperse my replies with yours... On 2/23/24 22:05, Andrei Borzenkov wrote:
On 24.02.2024 00:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them.
Normally they are created by display manager that starts X server. And that is what I expect also, but the question remains, why am I not seeing the X authority files being created at /run/user/1000 on some of my OpenSuSE 15.4 systems all running with the KDE/Plasma desktop and using the SDDM display manager?
I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system and I use it for/via the -auth parameter of x11vnc command and the x11vnc service can be started up OK. If my script does not find the X authority file at
If you start x11vnc from within your desktop session you automatically get the correct environment. I am starting x11vnc from a systemd service so that it is always available on remote systems that are inconvenient to access physically,
this first location then it assumes that it is running on OpenSuSE 15.3 or earlier and looks for the X authority file at ~/.Xauthority. And again (ASSUMING my script is running on an OpenSuSE 15.3 or earlier system) if my script finds it there it passes the location of the .Xauthority file to x11vnc via the -auth parameter and the xvncserver will start up an run OK.
The trouble is that on about half of my OpenSuSE 15.4 systems, the X authority file is not being created at /run/user/1000/ This causes my script to fall through to looking for the X authority file in the users home directory at ~/.Xauthority but using that for x11vnc via it's -auth parameter results in getting error messages such as this - in
23/02/2024 10:06:40 x11vnc version: 0.9.16 lastmod: 2019-01-05 pid: 23287 Invalid MIT-MAGIC-COOKIE-1 keyNo protocol specified 23/02/2024 10:06:40 XOpenDisplay(":0") failed. 23/02/2024 10:06:40 Trying again with XAUTHLOCALHOSTNAME=localhost ... Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key 23/02/2024 10:06:40 *************************************** 23/02/2024 10:06:40 *** XOpenDisplay failed (:0)
*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue. *** There may be "Xlib:" error messages above with details about the failure.
I believe the ~/.Xauthority file in my home directory may be a left-over file from when I was running previous versions of OpenSuSE? I get that feeling because if I delete the .Xauthority file (as some internet searches suggested) it is not recreated when I rebooted or log out, log back in. So I am guessing that ~/Xauthority files have been deprecated/removed from OpenSuSE 15.4 and later systems?
additional info -
OpenSuSE 15.4 x64
kf5-config --version Qt: 5.15.2 KDE Frameworks: 5.90.0 kf5-config: 1.0
plasmashell --version qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Crud! don't know how to solve this, maybe "plasmashell ---version" does not work over SSH?
SSH? How SSH suddenly comes in picture? You did not say anything about doing that remotely.
I guess you better take a step back and explain what you are trying to achieve, not how you think it should be done. Not trying to tell anyone how I think X Authority files should be created, simply what I have observed and empirically grokked is going on. Yes I a using SSH (and/or VNC when it is working) to access my remote systems. I didn't think that was important to mention in connection with trying to understand why I am missing the X authority files on some of my systems. I mentioned SSH only when I discovered I couldn't get the plasmashell version and guessed it might be due to my using SSH. Why do you think my usage of SSH is relevant to understanding why I am not finding the X authority file at /run/user/1000/ on some of my remote systems?
BTW, the plasmashell version I am running on one of my remote systems, that is not creating the X authority file at my expected location, is 5.24.4 HTHs, Marc
On 24.02.2024 21:02, Marc Chamberlin via openSUSE Users wrote:
Thanks Andrei for your time and responses, I will, like you did, intersperse my replies with yours...
On 2/23/24 22:05, Andrei Borzenkov wrote:
On 24.02.2024 00:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them.
Normally they are created by display manager that starts X server. And that is what I expect also, but the question remains, why am I not seeing the X authority files being created at /run/user/1000 on some of my OpenSuSE 15.4 systems all running with the KDE/Plasma desktop and using the SDDM display manager?
And where is it created?
I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system and I use it for/via the -auth parameter of x11vnc command and the x11vnc service can be started up OK. If my script does not find the X authority file at
If you start x11vnc from within your desktop session you automatically get the correct environment.
I am starting x11vnc from a systemd service so that it is always available on remote systems that are inconvenient to access physically,
x11vnc by definition mirrors your local session X server. There is no point in starting x11vnc until you have logged in locally. At which point you can just run it in session auto-start script. If you mean something else, then please explain what you are trying to achieve. Yes, it is possible to run x11vnc before you have logged in, but in this case Xauthority obviously cannot be in user specific directory (because no user is known yet).
On 2/24/24 11:25, Andrei Borzenkov wrote:
On 24.02.2024 21:02, Marc Chamberlin via openSUSE Users wrote:
Thanks Andrei for your time and responses, I will, like you did, intersperse my replies with yours...
On 2/23/24 22:05, Andrei Borzenkov wrote:
On 24.02.2024 00:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them.
Normally they are created by display manager that starts X server. And that is what I expect also, but the question remains, why am I not seeing the X authority files being created at /run/user/1000 on some of my OpenSuSE 15.4 systems all running with the KDE/Plasma desktop and using the SDDM display manager?
And where is it created? Where is what created? I don't understand your question, If you are asking me where are the X Authority files are created, I presume they are created in one of the two locations I have already pointed out. It seems to depend on what version of OpenSuSE is running. If 15.3 or earlier they seem to be created in each user's home directory ~/.XAuthority If !5.4 or later I find them usually at /run/user/UUID/xauth_<random characters>
When the X authority files should be created is when the first user logs in, and in our case there always is a "first" user that is automatically logged in when ever the system to restarted.
I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system and I use it for/via the -auth parameter of x11vnc command and the x11vnc service can be started up OK. If my script does not find the X authority file at
If you start x11vnc from within your desktop session you automatically get the correct environment.
I am starting x11vnc from a systemd service so that it is always available on remote systems that are inconvenient to access physically,
x11vnc by definition mirrors your local session X server. There is no point in starting x11vnc until you have logged in locally. At which point you can just run it in session auto-start script. If you mean something else, then please explain what you are trying to achieve.
Yes, it is possible to run x11vnc before you have logged in, but in this case Xauthority obviously cannot be in user specific directory (because no user is known yet).
I am not sure why it is necessary to describe our application in order to resolve/understand this issue with X authority files, but I will try to give a quick boiled down view - It is never the case that there will NOT be a user logged in on each of our remote systems. On each system we have a user we call "TheController_<some description here>" This user automatically logs in whenever there is a system reboot and then starts up applications which use GUIs. That's the reason for running OpenSuSE with the KDE/Plasma desktop on each of the remote systems. Also, on startup, each remote system also starts up services which support our needs, such as autofs,, sshd, etc., and that also includes a systemd service for x11vnc. Access to the remote systems is done either by encrypted SSH or VPN with a VNC tunnel. The x11vnc service supports access to display ::0 and is shared so that multiple users can remotely connect, via VNC, in order to see the desktop/apps running on display ::0. Multiple user access to display ::0 is critical and I was unable to find any other VNC server that supports it. Most seem to want to start new user/X sessions on separate displays, which won't work afaik. I tried using auto-start scripts a long time ago but gave up because I could not find a way to share/use display ::0, for/from separate logins, without running into permissions/security/obscurity hell. If the applications that run on the remote system (with are hardware control apps) followed the standard MVC model, then it would be possible to separate and run the view portion of the controllers in separate processes. That would facilitate the usage of VNC in the more standard way of having separate user logins for each VNC connection. Unfortunately the apps do not follow the MVC model yet. (I/we are working on it) This model of using VNC is NOT for the normal "separated" user experience on a remote system. Instead this is for a shared collaborative experience among a group of users. (Think of a teacher sharing his desktop in a classroom of students with laptops.) We informally decide who has control over the mouse/keyboard at any given moment. (Zoom and other shared teamwork tools don't work either because we need 24/7 access to the remote systems, and besides we have a strong desire to not teach old dogs new tricks, nor pay for middle man servers...LOL) X11vnc has worked well in the past, but now I'm running into this new hiccup that I am trying to understand/solve/fix. Marc...
On 25.02.2024 01:45, Marc Chamberlin via openSUSE Users wrote:
On 2/24/24 11:25, Andrei Borzenkov wrote:
On 24.02.2024 21:02, Marc Chamberlin via openSUSE Users wrote:
Thanks Andrei for your time and responses, I will, like you did, intersperse my replies with yours...
On 2/23/24 22:05, Andrei Borzenkov wrote:
On 24.02.2024 00:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them.
Normally they are created by display manager that starts X server. And that is what I expect also, but the question remains, why am I not seeing the X authority files being created at /run/user/1000 on some of my OpenSuSE 15.4 systems all running with the KDE/Plasma desktop and using the SDDM display manager?
And where is it created? Where is what created? I don't understand your question, If you are asking me where are the X Authority files are created, I presume they are created in one of the two locations I have already pointed out. It seems to depend on what version of OpenSuSE is running. If 15.3 or earlier they seem to be created in each user's home directory ~/.XAuthority If !5.4 or later I find them usually at /run/user/UUID/xauth_<random characters>
That is correct. Upstream used X authority file in the home directory, SUSE patch moved it to $XDG_RUNTIME_DIR and finally modified version of SUSE patch was merged upstream which puts X authority in /tmp. So the obvious first guess would be that some of your 15.4 systems are using older version of SDDM or may be are not using SDDM at all. That is all that can be guessed from the outside.
When the X authority files should be created is when the first user logs in, and in our case there always is a "first" user that is automatically logged in when ever the system to restarted.
All that I am asking - where X authority file is actually located for the user session. I do not know what "first" user means, but X authority you describe is created when user logs in - so you must have some user session to even start talking about X authority. If we know where these files are created, we may try to guess why they are created in the "wrong" location. ...
It is never the case that there will NOT be a user logged in on each of our remote systems. On each system we have a user we call "TheController_<some description here>" This user automatically logs in whenever there is a system reboot and then starts up applications which
If you have user session that automatically logs in - why on earth cannot you start x11vnc as part of this session startup? Why you insist that it must run as separate systemd service?
On 2024-02-23 22:46, Marc Chamberlin via openSUSE Users wrote:
Hello -
I am trying to grok how two X authority files get created and who/what is responsible for creating them. I have a script for starting up the x11vnc service and it needs to find the X authority file and looks for it in one of two places. The first location it looks for it is at /run/user/1000/xauth_* and if my script finds it there then my script assumes it is running on an OpenSuSE 15.4 or later system
Instead of assuming the openSUSE version, just find it out: cer@Telcontar:~> . /etc/os-release ; echo $VERSION 15.5 cer@Telcontar:~> -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)
participants (3)
-
Andrei Borzenkov
-
Carlos E. R.
-
Marc Chamberlin