Terminate a session

I connect to a thinlinc server which forwards me to an agent(only in in this test case). Everything works as expected (this is a single-app connection). I can terminate the session an start a new one - everything as expected. But when I turn of the terminal (a harsh but possible scenario) a new connection fails with - you’re not allowed to create any more sessions. Even though I have -f terminate. And yes I have max_session_per_usr set to 1.

What to do in this situation? I can’t terminate the session with tlctl, because it should be done automatically

Any ideas?

Hi @jean,

From a ThinLinc perspective, turning off the terminal should have essentially the same effect as disconnecting. So I’m surprised you’re not able to reconnect to the existing session.

After turning off the terminal, does tlctl session list still show your session?

You can also check /var/log/vsmagent.log on the agent server. If there are any error messages, please feel free to post them here.

Thank you for your reply.

I’ll describe the setup in a bit more detail; perhaps I’ve made a mistake.

I’m connecting from an IGEL terminal using ThinLINC 4.16 to a ThinLINC server 4.19, which then forwards to a 4.19 agent.

I start the connection with:

10.0.29.225 -f terminate -s “tl-single-app /opt/kiosk/kio-open.sh”

userid is the terminal name; the password is provided by the setup.

kio-open.sh is a script that ultimately starts Chromium for a Moodle session (for exams).

If the session is terminated normally (window or tab close), then

the output of tlctl session list is “connected.” Reconnecting works without any problems.

After shutting down the terminal and after rebooting and reconnecting, tlctl session list shows “disconnected” and the error “(You’re not allowed to create any more sessions)” appears.

In the master’s log file:

2026-02-26 09:21:55 DEBUG vsmserver: Handling method ‘create_user_socket’ from (‘127.0.0.1’, 41830)
2026-02-26 09:21:55 DEBUG vsmserver.session: User with uid 3005292 requested a socket
2026-02-26 09:21:55 DEBUG vsmserver: Handling method ‘create_user_socket’ from (‘127.0.0.1’, 41844)
2026-02-26 09:21:55 DEBUG vsmserver.session: User with uid 3005292 requested a socket
2026-02-26 09:21:55 DEBUG vsmserver: Handling method ‘get_capabilities’ on socket owned by uid 3005292
2026-02-26 09:21:55 DEBUG vsmserver: Handling method ‘create_user_socket’ from (‘127.0.0.1’, 41848)
2026-02-26 09:21:55 DEBUG vsmserver.session: User with uid 3005292 requested a socket
2026-02-26 09:21:55 DEBUG vsmserver: Handling method ‘get_user_sessions’ on socket owned by uid 3005292
2026-02-26 09:21:55 DEBUG vsmserver.session: User with uid 3005292 requested a list of his/her sessions

2026-02-26 09:21:55 DEBUG vsmserver: GetUserSessionHandler: List of groups: [3005214]

I then have to kill the sessions with tlctl.

Any idea what I’m doing wrong?

When ThinLinc fails to reconnect, are you still launching it with the -s "tl-single-app ..." option, or are you trying to create a “normal” session then?

In case you have a session running a specific program (through the -s option), you will not be reconnected to that same session unless you specify the same -s option as the existing session was started with. If another (or no -s option) is specified, ThinLinc will try to create a new session instead. This will result in the error you are describing with the default configuration of allowing at most one session per user.

Does reconnecting to the session work if done with the same -s option specified as when the session was initially started?

thank you for your answer.

yes, i always use the same parameters because its associated with an icon (the only one) on the desktop.

when i terminate the session “regulary” (close the tab oder window) the session is in status (tlctl ) connected but not a single process of that session is running on the agent server!

when i shutdown or reboot the terminal the processes of that session are still running on the agent and the connection fails with “not allowed anymore sessions”. the staus before the reconnection is on conected and after the error it changes to diconnected.

isn’t a little bit strange?

regards j.

Do you want different setups from different IGEL terminals? If it’s the same for all clients, I wonder if you would be able to set up this application through a ThinLinc profile rather than using -s "tl-single-app ...?

I suspect that would rid you of the “You’re not allowed to create any more sessions” problems.


You could create a profile in /opt/thinlinc/etc/conf.d/profiles.hconf (on the agent) like this:

[/profiles/moodle]
xdg_session=
name=Moodle
description=Moodle session for exams
icon=terminal.svg
screenshot=terminal-ss.png
cmdline=tl-single-app /opt/kiosk/kio-open.sh
testcmd=type /opt/kiosk/kio-open.sh
description_from_testcmd=false

By making sure only a single profile is listed in order your users won’t get a choice:

order=moodle

If you wish to disable the profile chooser intro, it can be done with:

show_intro=false

The -f terminate option could be approached differently by, for example, limiting how long a disconnected session is allowed to live. In /opt/thinlinc/etc/conf.d/vsmagent.hconf (on the agent) you can add -MaxDisconnectionTime to xserver_args:

xserver_args=-br -localhost -verbose 3 -MaxDisconnectionTime 60

See the following parts of our admin documentation:

1 Like

Thank you so much for looking into this, but I don’t want to take up too much of your time. The reason for my approach is that I have to accommodate many requirements: Moodle in kiosk mode, Moodle with additional websites, and a Jupyter server with varying requirements (I’m a victim of AI; exams are being monitored more closely ;-)).

The scripts I’m calling adjust the policy.json for Chromium (URLallowlist, etc.) and then finally run Chromium with the corresponding URL.

So, I only have one ThinlincServer (with multiple agents) with different options. Having the student choose a profile isn’t an option either.

There are several ways to exit the terminal and its application: closing the tab, closing the window, using the menu from “openbox(?) - minimize session, quit/logoff session”.

And, of course, shutting down the terminal. These exits are obviously handled differently and therefore don’t always respond to “-f terminate”—I can’t say whether this is a bug.

I’m currently working around it by allowing multiple sessions and also setting MaxDisconnectionTime. Fortunately, I have the resources.

In any case, thank you very much; without Thinlinc, administration would be much more difficult. Thanks for the great work!

1 Like

I see; thanks for explaining your use case. In your case, perhaps a start command is the most convenient solution.

As William mentioned, ThinLinc will display that error when attempting to start a new session with a different start command than what an existing session has. You should be able to check what command line the session is running with using tools like ps or tl-session-param.

PS, you are correct that the menu used for tl-single-app comes from Openbox.