When connecting with x2goclient to a Gentoo PC running x2goserver, then the LANG variable and the various LC_* variables are all empty.
/etc/env.d/02locale exists, contains LANG=de_DE.utf-8, and when not using the Gentoo PC remotely, everything is fine.
I suspect that somehow /etc/profile is never sourced. Not sure whether ~/.bashrc and/or ~/.bash_profile are sourced.
Obviously, this causes all kinds of problems (strange characters in terminal, etc.).
Steps to Reproduce:
In x2goclient, configure a session that launches a single application. As the command chose "Terminal" from the drop down. In my case, this will launch mate-terminal.
mate-terminal doesn't understand UTF-8 (ls -la shows broken folder names)
mate-terminal does understand UTF-8 (ls -la shows proper folder names)
This sounds very similar:
It's not the x2goclient who fails to set it. IMHO, the server needs to set it. More specifically, I think that x2goruncommand is to blame.
There is a small workaround I found here:
On the server you create a script x2go-german.sh
In x2go-client you choose "Custom Desktop" and uses x2go-german.sh as command.
It seems x2go has no support to set locale.
I have learned:
If you login in to the Server via ssh, pam sets the locale. This works fine if you log in with ssh user@server.
x2go login via ssh. pyhoca or x2goclient should know the locale but don't give it to the programs they start.
Programs on the server are started with x2goruncommand, which only run commands which are in the $PATH of the server.
quote from man x2goruncommand:
x2goruncommand <display> <agent_pid> <session_id> <command> <sound_system> <session_type>
Execute command <command>. Full paths will be ignored, the command has to be in the server's $PATH."
In the code of x2goruncommand I can't find any hint on the locale.
The only way you can to give your locale to a program is to open a shell on the server, set the locale and start the program.
My solution for thunderbird is:
Delete the link /usr/bin/thunderbird on server.
Create a script /usr/bin/thunderbird
=> Should this bug be a feature request?