Connection lasts less than 10 seconds

A ThinLinc system administrator using Ubuntu 20.04 contacted us and reported that he did not succeed to make ThinLinc work. He gets a message saying that the connection lasts less than 10 seconds and that it may have a setup problem. What should be checked to solve this issue? What are the most common causes?

1 Like

the log files on the server … to see why the thinlinc session is dying there … the content of /var/opt/thinlinc might be interesting

2 Likes

Yes - specifically /var/opt/thinlinc/sessions/<username>/last/xinit.log. This file should contain information about why the session failed to start (or ended very quickly).

1 Like

Dear @muitotri, thanks for your invitation to participate from this community, and for posting my issue. Dear @tobias.oetiker and @aaron, thank you for your immediate support as well. My apologies for the long time I took to reply your comments. Please see below the log info. Any additional suggestion on how to solve the issue will be very welcome.

Regards
Alex

xauth:  file /var/opt/thinlinc/sessions/.../11/Xauthority does not exist
tl-xinit: Waiting for Xserver to accept connections...

Xvnc ThinLinc release 4.14.0 build 2408 - built Jan 26 2022 10:15:02
Copyright (C) 1999-2022 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12013000

(II) Initializing extension VNC-EXTENSION

Sat Jul  2 13:24:20 2022
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on local interface(s), port 5911
 vncext:      created VNC server for screen 0
(II) Initializing extension Generic Event Extension
(II) Initializing extension SHAPE
(II) Initializing extension MIT-SHM
(II) Initializing extension XInputExtension
(II) Initializing extension XTEST
(II) Initializing extension BIG-REQUESTS
(II) Initializing extension SYNC
(II) Initializing extension XKEYBOARD
(II) Initializing extension XC-MISC
(II) Initializing extension XFIXES
(II) Initializing extension RENDER
(II) Initializing extension RANDR
(II) Initializing extension COMPOSITE
(II) Initializing extension DAMAGE
(II) Initializing extension MIT-SCREEN-SAVER
(II) Initializing extension DOUBLE-BUFFER
(II) Initializing extension RECORD
(II) Initializing extension DPMS
(II) Initializing extension Present
(II) Initializing extension DRI3
(II) Initializing extension X-Resource
(II) Initializing extension XVideo
(II) Initializing extension XVideo-MotionCompensation
(II) Initializing extension GLX
(II) IGLX: Loaded and initialized swrast
(II) GLX: Initialized DRISWRAST GL provider for screen 0
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
 Connections: accepted: 127.0.0.1::36744
 VNCSConnST:  closing 127.0.0.1::36744: Clean disconnection
 EncodeManager: Framebuffer updates: 0
 EncodeManager:   Total: 0 rects, 0 pixels
 EncodeManager:          0 B (1:-nan ratio)
 Connections: closed: 127.0.0.1::36744
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
tl-xinit: Xserver ready for clients.

Sat Jul  2 13:24:21 2022
 Connections: accepted: 127.0.0.1::36746
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type VncAuth(2)
 VNCSConnST:  Replacing existing connection
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
/etc/profile.d/setup_readline.sh: line 1: bind: warning: line editing not enabled
/etc/profile.d/setup_readline.sh: line 2: bind: warning: line editing not enabled
--- System information ---
ThinLinc 4.14.0
Linux gff 5.4.0-121-generic #137-Ubuntu SMP Wed Jun 15 13:33:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 20.04.4 LTS \n \l

No LSB modules are available.
--- End system information ---
xsetroot:  unable to open display 'gff:10.0'
Cannot find xsri. Background image support not available.
xsetroot:  unable to open display 'gff:10.0'
Failed to open display
/opt/thinlinc/libexec/xprop:  unable to open display 'gff:10.0'
Openbox-Message: Failed to open the display from the DISPLAY environment variable.
Running /opt/thinlinc/etc/xstartup.d/01-tl-kinit.sh (Obtaining Kerberos ticket)
Running /opt/thinlinc/etc/xstartup.d/02-tl-dbus-launch.sh (Starting session D-Bus server)
Existing session D-Bus server found.
Setting initial D-Bus and systemd environment...
Unable to init server: Could not connect: Connection refused
Running /opt/thinlinc/etc/xstartup.d/11-tl-set-title (Setting client window title)
Unable to init server: Could not connect: Connection refused
Running /opt/thinlinc/etc/xstartup.d/12-tl-default-keyboard (Configuring default keyboard layout)
Unable to init server: Could not connect: Connection refused
/opt/thinlinc/libexec/tl-run-xstartup-feedback: warning: Unable to initialize GTK+
/opt/thinlinc/libexec/tl-run-xstartup-feedback: warning: Won't present xstartup.d feedback
Setting default keyboard layout to "us"
Cannot open display "gff:10.0"
Running /opt/thinlinc/etc/xstartup.d/15-tl-shadow-notify (Enabling notifications when the session is shadowed)
Can't open display: gff:10.0
Running /opt/thinlinc/etc/xstartup.d/20-tl-select-profile.sh (Choosing a profile)
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
/opt/thinlinc/libexec/tl-select-profile: warning: Unable initialize GTK+
/opt/thinlinc/libexec/tl-select-profile: warning: Can't show introduction text
/opt/thinlinc/libexec/tl-select-profile: warning: Using first available profile as fallback
Running /opt/thinlinc/etc/xstartup.d/30-tl-xdg-user-dirs (Translating standard folders)
Running /opt/thinlinc/etc/xstartup.d/40-tl-mount-localdrives (Mounting local drives)
Running /opt/thinlinc/etc/xstartup.d/41-tl-lp-redir-launch (Setting up printer port redirection)
Unable to open DISPLAY, exiting ...
Running /opt/thinlinc/etc/xstartup.d/43-tl-pulseaudio-launch.sh (Starting session PulseAudio server)
Unable to open DISPLAY, exiting ...
Failed to start session PulseAudio server
Running /opt/thinlinc/etc/xstartup.d/50-tl-wait-smartcard (Waiting for smart card connection)
Stopping initial window manager...
Openbox-Message: Failed to open the display from the DISPLAY environment variable.
Done.
Executing profile: ubuntu
Using XDG session: ubuntu
Updating D-Bus and systemd environment...
Ignoring invalid environment variable: 'BASH_FUNC_spack%%'
Executing XDG session command: env GNOME_SHELL_SESSION_MODE=ubuntu /usr/bin/gnome-session --systemd --session=ubuntu
Profile command exited with exit code 1
Running /opt/thinlinc/etc/xlogout.d/tl-kdestroy.sh
Running /opt/thinlinc/etc/xlogout.d/tl-umount-localdrives
tl-xinit: client terminated and returned 0
tl-xinit: Terminating X server...

Sat Jul  2 13:24:26 2022
 VNCSConnST:  closing 127.0.0.1::36746: Server shutdown
 EncodeManager: Framebuffer updates: 1
 EncodeManager:   Tight:
 EncodeManager:     Solid: 1 rects, 786.432 kpixels
 EncodeManager:            16 B (1:196609 ratio)
 EncodeManager:   Total: 1 rects, 786.432 kpixels
 EncodeManager:          16 B (1:196609 ratio)
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
tl-xinit: X server has terminated
tl-xinit: deleting ../11.1656778675.ended
tl-xinit: Session terminated. Exiting.

Hi @abonatto, welcome to the forum.

There is something strange with your user environment here. The $DISPLAY variable is being set with a hostname (gff) which either can’t be resolved, or isn’t accessible.

Are you logged in locally (i.e. at the computer) as the same user as you are trying to connect to ThinLinc with? Is there anything in your home directory, for example ~/.bashrc, which might be manipulating the $DISPLAY variable?

If you’re unsure, you could try creating a new user on the system and connecting as them instead.

1 Like

Hi @aaron,

Indeed, I had the following line in my .profile:

export DISPLAY='gff:10.0'

It was added ages ago, when I was trying to solve some issues with remote access of graphical applications (I do not remember the context). I just commented it, logged out and in, and now the ThinLinc client works flawlessly!

Thank you (and thanks @muitotri and @tobias.oetiker as well) for sharing your knowledge and helping me solving this issue.

Cheers,
Alex

You’re welcome @abonatto, if there is anything else just let us know.

1 Like

I have the same issue! From M3 Macbook pro to centos 7 server.

here is the complete error on looking into xinit log file

more -f /var/opt/thinlinc/sessions/USER/last/xinit.log

xauth: file /var/opt/thinlinc/sessions/USER/1/Xauthority does not exist
tl-xinit: Waiting for Xserver to accept connections…

Xvnc ThinLinc release 4.8.0 build 5456 - built May 19 2017 02:37:54
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11400000, The X.Org Foundation

Initializing built-in extension VNC-EXTENSION
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension GLX

Thu Jun 27 16:06:27 2024
vncext: VNC extension running!
vncext: Listening for VNC connections on local interface(s), port 5901
vncext: created VNC server for screen 0
(II) AIGLX: Loaded and initialized swrast
(II) GLX: Initialized DRISWRAST GL provider for screen 0
[dix] Could not init font path element /usr/share/fonts/default/Type1, removing from list!

Thu Jun 27 16:06:28 2024
Connections: accepted: 127.0.0.1::64086
Connections: closed: 127.0.0.1::64086 (Clean disconnection)
EncodeManager: Framebuffer updates: 0
EncodeManager: Total: 0 rects, 0 pixels
EncodeManager: 0 B (1:-nan ratio)
ComparingUpdateTracker: 0 pixels in / 0 pixels out

ComparingUpdateTracker: (1:-nan ratio)
tl-xinit: Xserver ready for clients.

Thu Jun 27 16:06:29 2024
Connections: accepted: 127.0.0.1::64088
SConnection: Client needs protocol version 3.8
SConnection: Client requests security type VncAuth(2)
VNCSConnST: tl-shadow-notify: OpenAuthenticatedConnection
VNCSConnST: Replacing existing connection
VNCSConnST: Server default pixel format depth 24 (32bpp) little-endian rgb888
— System information —
ThinLinc 4.8.0
Linux xxxxxxxx.SERVER 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.9.2009 (Core)
LSB Version: :core-4.1-amd64:core-4.1-ia32:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-ia32:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
— End system information —
Cannot find xsri. Background image support not available.
Fontconfig error: “/etc/fonts/conf.d/10-scale-bitmap-fonts.conf”, line 71: non-double matrix element
Fontconfig error: “/etc/fonts/conf.d/10-scale-bitmap-fonts.conf”, line 71: non-double matrix element
Fontconfig warning: “/etc/fonts/conf.d/10-scale-bitmap-fonts.conf”, line 79: saw unknown, expected number
Running /opt/thinlinc/etc/xstartup.d/00-tl-pulseaudio-env.sh (Setting up PulseAudio environment variables)
Running /opt/thinlinc/etc/xstartup.d/01-tl-kinit.sh (Obtaining Kerberos ticket)
kinit: Configuration file does not specify default realm when parsing name USER
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
Running /opt/thinlinc/etc/xstartup.d/02-tl-dbus-launch.sh (Starting session D-Bus server)
Running /opt/thinlinc/etc/xstartup.d/11-tl-set-title (Setting client window title)
Running /opt/thinlinc/etc/xstartup.d/12-tl-default-keyboard (Configuring default keyboard layout)
Setting default keyboard layout to “us”
Running /opt/thinlinc/etc/xstartup.d/20-tl-select-profile.sh (Choosing a profile)
Running /opt/thinlinc/etc/xstartup.d/30-tl-xdg-user-dirs (Translating standard folders)
No default user directories
Running /opt/thinlinc/etc/xstartup.d/40-tl-mount-localdrives (Mounting local drives)
Running /opt/thinlinc/etc/xstartup.d/41-tl-lp-redir-launch (Setting up printer port redirection)
Running /opt/thinlinc/etc/xstartup.d/43-tl-pulseaudio-launch (Starting session PulseAudio server)
W: [pulseaudio] main.c: Couldn’t canonicalize binary path, cannot self execute.
Session PulseAudio server started
Running /opt/thinlinc/etc/xstartup.d/50-tl-wait-smartcard (Waiting for smart card connection)
Stopping initial window manager…
Done.
Executing profile: xfce
Using XDG session: xfce
Executing XDG session command: startxfce4
/bin/startxfce4: X server already running on display :1
/bin/sh: /etc/xdg/xfce4/xinitrc: Permission denied
Profile command exited with exit code 126
Running /opt/thinlinc/etc/xlogout.d/tl-kdestroy.sh
kdestroy: No credentials cache found while destroying cache
Running /opt/thinlinc/etc/xlogout.d/tl-umount-localdrives
tl-xinit: client terminated and returned 0
tl-while-x11: lost Xserver connection, terminating child 2555 …
tl-while-x11: lost Xserver connection, terminating child 2561 …
tl-xinit: deleting …/1.1719480735.ended
tl-xinit: Session terminated. Exiting.

Hi,

Looks like ThinLinc is starting just fine, but your Xfce is failing to start:
/bin/sh: /etc/xdg/xfce4/xinitrc: Permission denied

Also, I noted that you’re running an ancient and unsupported version of ThinLinc. You should, if possible, upgrade to 4.16.0 which is the latest released version.

Kind regards,
Martin

Thanks for pointing out. ThinLinc version for linux server you mean ? The one I am connecting from my mac is 4.16.0

Yes, the ThinLinc server version is reported to be 4.8.0 from your attached log:

— System information —
ThinLinc 4.8.0