If I lose connection abruptly, I cannot reconnect and see my server's screen again

Hi all,

Firstly, thanks for the amazing software that is Thinlinc.

Short description of the problem

I installed Thinlinc in a workstation in my office, to work as a server. I access it through my laptop, used as the client. Both run Ubuntu 23.04. Everything works great, except for the following. When I am working from my laptop and accessing the office server through Thinlinc, if I abruptly lose connection (say, for example, by briefly losing access to WiFi or having a 5G instability on the laptop side), attempting to reconnect to the server via Thinlinc succeeds but Thinlinc gets stuck in its initial GUI screen and does not actually display my server.

Detailed description of the problem

Suppose I am working from my laptop, connected to my server via Thinlinc. If anything makes the laptop abruptly lose access to internet connection (say, a bad WiFi or 5G signal), then Thinlinc naturally closes and displays this following error:

"Your connection to the server was unexpectedly shut down:

Connection reset by peer

If you don’t know what caused this, please contact your system administrator."

Then, if I try reopening Thinlinc in my laptop and reconnect to my server, it seems that the connection is established since no error is shown. But Thinlinc gets stuck on this screen:

If I then open a terminal in my laptop, I can still successfully and normally ssh into my server. If I run who -u I see entries with:

myusername thinlinc/10
myusername thinlinc/11


Note 1: it’s as if Thinlinc was getting stuck in the same way it does when one tries to connect to a server which had been locally logged into with the same user as one is trying to log with remotely.

Note 2: if when I ssh into my server I kill those thinlinc/10 and thinlinc/11 users’ PID, then I can then connect again from my laptop to my server via Thinlinc (but of course, everything I was doing on the server side is now closed and lost).


Am I missing something obvious? How should I handle this?

Hi @MarkDP,

Welcome to the forum, and thanks for the detailed report.

You should be able to find more information about what’s happening in the session log files, which you can find at /var/opt/thinlinc/sessions/<username>/last/xinit.log. However, the unfortunate reality is that most desktop environments don’t support running multiple sessions as the same user anymore.

The easiest way around this is probably just to limit each user to a single session. This can be done by setting the max_sessions_per_user parameter to 1:

tl-config /vsmserver/max_sessions_per_user=1

Is this something which would work for you?

Thanks @aaron! Would it be helpful I copy-paste that log in here?

I am actually not interseted in running multuple sessions with the same user at all. If that is what is happening, it’s unintended. That is, I did not log to the server in any way before using Thinlinc. Whatever session was created originally, it was by me connecting to the server via Thinlinc. Therefore, when the connection is lost, Thinlinc may be trying to reconnect to the same session but can’t because it’s the same user?

If that is the case, would setting the parameter was you suggest solve that? Because I do not mind setting max_sessions_per_user=1.

Thanks very much!

In all honesty, probably not. It might be interesting just to see what’s going on, but the best solution is likely to be restricting your user to a single session, since that’s all you require anyway.

So feel free to set max_sessions_per_user to 1, and let us know if this solves the problem for you :slight_smile: