Hello,
the /usr/bin/x2gostartagent script does not sufficiently specify the location of $XAUTHORITY file for the xauth command, while the command line for starting x2goagent refers to a specific location $HOME/.Xauthority.
Usually, this works, because if nothing is specified on the command line for xauth and the $XAUTHORITY variable is not defined, it falls back to $HOME/.Xauthority.
Nonetheless, recent GDM versions set XAUTHORITY to /var/run/gdm/auth-for-$USER-blabla/database.
As a result, when opening a shadow session as another user, /usr/bin/x2gostartagent adds the cookie to $XAUTHORITY (/var/run/gdm...) and then starts x2goagent -auth $HOME/.Xauthority, which fails obviously.
The attached patch removes the -f $HOME/.Xauthority parameter from the x2goagent command line to resolve the problem. It also removes a redundant '-S' parameter (there is already $SESSION_TYPE there).
Can users of other distributions or display managers test if it does not break something else? (It works on Arch Linux with GDM and Xfce.)
Regards,
Milan
-- http://www.milan-knizek.net/ About linux and photography (Czech only) O linuxu a fotografování