When vgl is invoked the first time, apparently a race condition does not allow it to correctly set Xauthority. When ran a second time, it works flawlessly. Apparently, a "sleep 1" before xauth -f /var/lib/VirtualGL/vgl_xauth_key add $DISPLAY . $(xauth -f $XAUTHORITY list | awk '{print $3;exit}') && \ chmod 644 /var/lib/VirtualGL/vgl_xauth_key Fixes the race and makes the init script work reliably every time, but I hope there is a better fix :-) Reproducible: Always
Is this only when using with SDDM?
It happened only with SDDM, but I cannot tell whether it is specific.
is this still happening with 2.6.x versions?
Indeed it is. My solution however was to stop using it.
A better way would be to create a soft link to the server $XAUTHORITY file and delete the soft link when the service stop BTW for sddm v.0.20 the new way of detecting the $XAUTHORITY file (in /etc/conf.d/vgl) is XAUTHORITY=$(find /run/sddm/ 2>/dev/null | tail -n1) The common case that should work in almost all environments doesn't work for the latest sddm.