Multiple concurrent desktop sessions/black screen issue

Asked by msaxl

Since the introduction of systemd or specifically user@.service it is not possible to launch multiple graphical sessions per user.
This seems to be by design (or at least it is a consequence of how XDG_RUNTIME_DIR and DBUS_SESSION_BUS are used within systemd)

There is no warning message that informs the user that logging in in xrdp when for example a console graphical session is running for the same user is not possible. Instead either the display is black (plasma) or the user is logged out immediatly (gnome-session)

in
https://github.com/neutrinolabs/xrdp/issues/2491
there is mentioned a way to at least inform the user if such a thing happens by hooking /etc/X11/Xsession.d/

there is also a tool
https://github.com/matt335672/nest-systemd-user
that enables the creation on a nested systemd-user.

I think the single session enforcement should be included downstream.
Regarding the systemd-user nesting I like to note that snapd would need to be patched (probably not a big change). Mainly snap would have to "import" the right XDG_RUNTIME_DIR instead of using /run/user/$UID.

I raised this question mainly to start a discussion how to proceed here and if Ubuntu would consider supporting systemd-user nesting (that could also be used in other situations) in snap (the only software component that I found does not fully work right oob; mainly pulseaudio passthru)

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu xrdp Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What are you wanting to do on the remote system? There may be a sleeker solution to what you want to acheive.

What will the users be doing on the desktops once connected?

Revision history for this message
msaxl (saxl) said :
#2

The issue here is that a novice user that installs xrdp might test if xrdp is working by using a user (probably the only one on the system) that is already logged in. This however does not work, but we don't really say the user why.

For upstream this is kinda out of scope since the issue comes from the downstream distribution that uses systemd.
Of course everyone is well aware that systemd is quite widespread, but until now no definitive solution was found.

A downstream workaround could be putting something like

if systemctl --quiet --user is-active graphical-session.target; then
    xmessage -button Logout:1,Terminate\ running\ graphical\ session:2 "Only a single graphical session is allowed.
If you terminate the currently running graphical session all unsaved data in that session will be lost"
    action=$?
    if [ $action -eq 2 ]; then
      systemctl --user stop graphical-session.target
      sleep 1
    else
      exit 0
    fi
fi

somewhere in /etc/X11/Xsession.d/

This way at least the user gets a message that tells the user the limitations

The reason why I mentioned https://github.com/matt335672/nest-systemd-user is to point on the effort on xrdp's side to lift that limitation. This tool however may also be used to start a desktop inside for example Xephyr using the same user.

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.