Why does starting multiple ThinLinc sessions as the same user sometimes fail?

One feature of ThinLinc is the ability to start and manage multiple sessions as the same user. When logging in with the native client, if you already have one or more existing sessions on the server, then you have the option of reconnecting to an existing session, or starting a new one. As an administrator, you have the ability to restrict your users to a maximum number of concurrent sessions.

If ThinLinc is installed in a cluster configuration, a user with multiple sessions may find that each one resides on a different server. If ThinLinc is installed on a single server, however, all a user’s sessions will share the same system.

Some Linux distributions and desktop environments (DEs) are unfortunately not well-suited to running multiple graphical sessions as the same user. They expect each user to have a maximum of one such session and, while they do not explicitly forbid it, creating additional sessions on the same system may fail. This can result in a ThinLinc user being unable to log in without ending their existing session first.

This behaviour appears to be getting more common as distributions and desktop environments mature. Initially, this limitation was most commonly encountered when using compositing desktop environments such as GNOME 3 or KDE Plasma. However, we are now seeing it more often in “lightweight” DEs too, such as XFCE and MATE. Some of these limitations also appear at operating system level, and will therefore occur regardless of which DE you happen to be using.

Examples of such limitations are: processes competing for the same file lock, processes competing for the same D-Bus name, or system-level limitations on the number of open file handles per user. If you suspect that you or your users are being affected by such limitations, it may help to look in the session log file at /var/opt/thinlinc/sessions/<user>/last/xinit.log on the ThinLinc server, immediately after failing to create a new session.

Because these limitations lie outside of ThinLinc itself, in most cases it is not possible for us to work around them. If the issue is a system-level limitation then it may be possible to increase this limit. However, in the case of a DE’s inability to handle multiple sessions per user, the solution may be to simply find one which can. You could also try to manage your (or your users’) workflow so that they do not require multiple sessions, or report a bug against the DE or distribution in question.

If you have any experience with using multiple sessions per user on different distributions, desktop environments, and versions thereof, please feel free to share below.


For more information on ThinLinc’s multiple session handling, see TAG Chapter 7.  The ThinLinc Client

For more information on session startup, and configuring available profiles in ThinLinc, see TAG chapter 14.4.  Customizing the User's Session

3 Likes

Thanks for this informative post.

Does anyone have a list of tried and tested DEs for this type of setup, as of 2022?

Hi @martin1, unfortunately not. Things are constantly changing, and it can also depend a bit on your use case. The best advice I could give you at present would be to test a couple of DEs and see which one works best for you, or alternatively restrict users to a single concurrent session.

Tip for those requiring multiple XFCE sessions as the same user.

If XFCE fails to start more than one concurrent session as the same user, the following line can be added to the xfce stanza in profiles.hconf as a workaround:

cmdline=env -u SESSION_MANAGER -u DBUS_SESSION_BUS_ADDRESS xfce4-session

Note that this is a workaround for behaviour in XFCE, not ThinLinc, so YMMV. However, we do know of some ThinLinc customers who are using this successfully.

Note also that if you are on RHEL9, you will need to make sure that the dbus-x11 package is installed for this to work.

1 Like

Yes, this is annoying. It is possible to attach to a single session multiple times? Currently if you connect to a already running session, the first connection closes. I would like an option to simply connect to it in addition to the first connection. Think of it as shadowing yourself.

The use case for this I have folks who use multiple systems in a single room and move between them all day. It would be great if their session could be on all of the systems. Using virtual desktops would make it a simple click to have a different desktop for each physical location. No issues with the multiple sessions sharing the home directory.

Is such a thing possible?

Hi @michaelo,

ThinLinc does have a shadowing feature, but I’m not sure it would give you quite what you’re after. See here:

https://www.cendio.com/resources/docs/tag/shadowing.html

Check your max_sessions_per_user parameter. If this is set to 1, then you’ll get the behaviour you describe.

Yeah, I am familiar with the shadowing feature. It could sort of do it, but the permissions required would be prohibitive. Also, it’s not seamless.

Best would be when you connect and there is an already existing session, instead of taking it over, instead just ask if you want to share it In reality it could just be a shadow session, but one only applicable to the same login as the shadowed session.