FS#67869 - [tigervnc] vncserver: Couldn't find suitable Xsession.

Attached to Project: Community Packages
Opened by Just Glats (glats) - Thursday, 10 September 2020, 19:32 GMT
Last edited by Sergej Pupykin (sergej) - Thursday, 12 November 2020, 20:43 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Description:

trying to initialize vncserver shows:
vncserver: Couldn't find suitable Xsession.

Additional info:
package version(s) -- tigervnc-1.11.0-2-x86_64

Reading the code https://github.com/TigerVNC/tigervnc/blob/1aceb7045b424494c984bac195c18ad9555c237f/unix/vncserver/vncserver.in#L441
it try to find this two directories: "/etc/X11/xinit/Xsession", "/etc/X11/Xsession" and I think archlinux doesn't have those directories.

Steps to reproduce:

run as normal user
$ vncserver :1
vncserver: Couldn't find suitable Xsession.
This task depends upon

Closed by  Sergej Pupykin (sergej)
Thursday, 12 November 2020, 20:43 GMT
Reason for closing:  Fixed
Comment by Sergej Pupykin (sergej) - Thursday, 10 September 2020, 22:10 GMT
Yes, I think this `die` is too much
die "$prog: Couldn't find suitable Xsession.\n";
and can be removed.
Comment by Just Glats (glats) - Thursday, 10 September 2020, 22:13 GMT
Yeah I think the same way.
should we open an issue on github?
Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 12:08 GMT
My guess is we need to create symlink to one of these scripts:
extra/gdm 3.36.3-6 (gnome)
etc/gdm/Xsession
extra/lightdm 1:1.30.0-4
etc/lightdm/Xsession
extra/sddm 0.18.1-3 [installed]
usr/share/sddm/scripts/Xsession
extra/xorg-xdm 1.1.12-3 [installed]
etc/X11/xdm/Xsession
community/lxdm 0.5.3-7 (lxde) [installed]
etc/lxdm/Xsession
community/lxdm-gtk3 0.5.3-7 (lxde-gtk3)
etc/lxdm/Xsession

Mentioned Xsession is usually part of xorg-xinit package in other distros.
Comment by Just Glats (glats) - Friday, 11 September 2020, 12:39 GMT
Could be good fix. But in my case I use archlinux as server and I haven't installed any DM. Vnc server hits directly on openbox.
I see two options:
- open an issue on github asking what's the best option.
- patch the code and change Xession for xinit or something like that.
Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 12:55 GMT
I added all available Xsession files to try in 1.11.0-3.

In case you do not want to install DM, you can create one line bash script that just starts what you need.
Comment by Just Glats (glats) - Friday, 11 September 2020, 12:58 GMT
yes that's what I did. But i think this has to be documented in somewhere (wiki perhaps) or add a file in the package like you did.
Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 13:17 GMT
Yes, https://wiki.archlinux.org/index.php/TigerVNC looks outdated. They switched from ~/.vnc/xstartup to Xsessions.
Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 13:21 GMT
I marked it as out of date, maybe update wiki later.
Comment by Oleksandr Natalenko (post-factum) - Friday, 11 September 2020, 15:32 GMT Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 16:08 GMT
uploaded tigervnc-1.11.0-4
Comment by John (graysky) - Friday, 11 September 2020, 19:55 GMT Comment by Sergej Pupykin (sergej) - Friday, 11 September 2020, 20:45 GMT
Maybe we need to add own Xsession to tigervnc or to xorg-xinit to avoid failure when no DM installed.
Comment by John (graysky) - Friday, 11 September 2020, 20:57 GMT
@sergej - That could work...

From an strace, it seems it looks here:
[pid 28122] stat("/etc/X11/xinit/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/etc/X11/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/etc/X11/xdm/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/usr/share/sddm/scripts/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/etc/gdm/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/etc/lightdm/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)
[pid 28122] stat("/etc/lxdm/Xsession", 0x55938c6bd4b8) = -1 ENOENT (No such file or directory)

I believe that no package is currently providing `/etc/X11/xinit/Xsession` which is one of the files tigervnc is looking for... we could provide one there?

The Xsession that lightdm provides works on my machine for this purpose. I attached it here for reference.
   Xsession (1.4 KiB)
Comment by John (graysky) - Sunday, 13 September 2020, 16:14 GMT
@sergej - I took a stab at fixing up the wiki just now. I think we need to add a piece regarding the need to have an Xsession if one is not yet on the box, but I think that's dependent on your actions with the package regarding providing the one per my last comment.
Comment by Matthias Klein (matthiasklein) - Monday, 14 September 2020, 09:22 GMT
I use tigervnc headless in combination with MATE. It was started with the following systemd unit:

/etc/systemd/system/vncserver@.service
--------------------------------------
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
User=user
WorkingDirectory=/home/user
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver %i -geometry 1440x900 -alwaysshared -localhost no
ExecStop=/usr/bin/vncserver -kill %i

[Install]
WantedBy=multi-user.target


Since the last update I also got the "vncserver: Couldn't find suitable Xsession" problem.
with the Xsession from the thread here, I can start tigervnc again on the command line / SSH.

Unfortunately I can't get an autostart via systemd to run anymore.
I get the following errors:

Sep 14 09:36:01 WS-MAK vncserver[454]: Failed to connect to bus: Datei oder Verzeichnis nicht gefunden
Sep 14 09:36:01 WS-MAK vncserver[455]: dbus-update-activation-environment: error: unable to connect to D-Bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
Sep 14 09:36:01 WS-MAK vncserver[452]: X session wrapper complete, running session mate-session
Sep 14 09:36:08 WS-MAK vncserver[452]: mate-session[452]: WARNING: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=MATE environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK vncserver[452]: mate-session[452]: WARNING: Could not make bus activated clients aware of DISPLAY=:1 environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK vncserver[452]: mate-session[452]: WARNING: Could not make bus activated clients aware of MATE_DESKTOP_SESSION_ID=this-is-deprecated environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK mate-session[452]: WARNING: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=MATE environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK mate-session[452]: WARNING: Could not make bus activated clients aware of DISPLAY=:1 environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK mate-session[452]: failed to commit changes to dconf: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK mate-session[452]: WARNING: Could not make bus activated clients aware of MATE_DESKTOP_SESSION_ID=this-is-deprecated environment variable: Verbindung ist gescheitert: Verbindungsaufbau abgelehnt
Sep 14 09:36:08 WS-MAK vncserver[452]: mate-session[452]: WARNING: Could not make bus activated clients aware of SESSION_MANAGER=local/WS-MAK:@/tmp/.ICE-unix/452,unix/WS-MAK:/tmp/.ICE-unix/452 environment variable: Verbindung ist gescheitert: Verbindung>
Sep 14 09:36:08 WS-MAK mate-session[452]: WARNING: Could not make bus activated clients aware of SESSION_MANAGER=local/WS-MAK:@/tmp/.ICE-unix/452,unix/WS-MAK:/tmp/.ICE-unix/452 environment variable: Verbindung ist gescheitert: V


Does anyone have a currently working systemd unit?
Comment by Oleksandr Natalenko (post-factum) - Monday, 14 September 2020, 09:24 GMT
Consider following https://bbs.archlinux.org/viewtopic.php?pid=1925761 first, one does not need custom units.
Comment by Matthias Klein (matthiasklein) - Monday, 14 September 2020, 11:16 GMT
Many thanks for the hint!

I had already skimmed the thread in the forum, but I hadn't noticed that the approach works completely without an own systemd unit file.

Now everything runs again. ( I installed lightdm and removed the XSession from this thread )
Comment by Just Glats (glats) - Monday, 14 September 2020, 12:30 GMT

So a display manager is mandatory now? not optimal for a server
Comment by Matthias Klein (matthiasklein) - Monday, 14 September 2020, 12:39 GMT
I think a display manager is not mandatory, but a Xsession file.

And I took the pill lightdm, to get a maintained Xsession file. (The display manager is not running)
Comment by John (graysky) - Monday, 14 September 2020, 14:23 GMT Comment by Just Glats (glats) - Monday, 14 September 2020, 14:28 GMT
I really think I'll open a github issue to see if Xession can be optional or something.
How many distros doesn't provide Xession as default? Depending on that perhaps the developers could consider taking it as mandatory
Comment by John (graysky) - Monday, 14 September 2020, 15:46 GMT Comment by Just Glats (glats) - Monday, 14 September 2020, 21:05 GMT
OK. So in the end: what's the final fix for tigervnc to work outbox on archlinux?
I mean everything needed in the build to be installed and configured on a local machine.
Comment by John (graysky) - Monday, 14 September 2020, 21:17 GMT
@glats - I spent the time to update the wiki, please review it.
Comment by Just Glats (glats) - Monday, 14 September 2020, 21:23 GMT
Ok. We should close the issue then.
Comment by John (graysky) - Monday, 14 September 2020, 21:25 GMT
@glats - No, @sergej still has a decision to make: https://bugs.archlinux.org/task/67869#comment192650
Comment by Just Glats (glats) - Monday, 14 September 2020, 21:41 GMT
I thought there was nothing more to see after seeing the issue on github.
The decision is quite hard for what I'm seeing. Keep archlinux free from Xession or break the structure a bit and add it.
Comment by John (graysky) - Thursday, 17 September 2020, 14:02 GMT
@glats - No, we can provide a generic script.
Comment by Sergej Pupykin (sergej) - Saturday, 19 September 2020, 16:46 GMT
I've added copy of lightdm Xsession file into package and install it into /etc/X11/tigervnc/Xsession.
Comment by Duane Voth (duanev) - Tuesday, 06 October 2020, 21:21 GMT
just fyi:
# pacman -U /var/cache/pacman/pkg/tigervnc-1.10.1-2-x86_64.pkg.tar.zst
warning: downgrading package tigervnc
...
And it will stay downgraded through future updates until you reinstall the current package.

Loading...