Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 538458 - net-misc/x2goclient fails to set locale
Summary: net-misc/x2goclient fails to set locale
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
Depends on:
Reported: 2015-02-01 17:09 UTC by Sven
Modified: 2016-01-24 23:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2015-02-01 17:09:47 UTC
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.).

Reproducible: Always

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.
Actual Results:  
mate-terminal doesn't understand UTF-8 (ls -la shows broken folder names)

Expected Results:  
mate-terminal does understand UTF-8 (ls -la shows proper folder names)
Comment 1 Sven 2015-02-01 17:10:11 UTC
This sounds very similar:
Comment 2 Sven 2015-02-02 12:02:50 UTC
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.
Comment 3 Kai Wüstermann 2015-04-02 13:15:31 UTC
There is a small workaround I found here:

On the server you create a script

export LANG=de_DE.UTF-8
exec however_you_start_your_desktop

In x2go-client you choose "Custom Desktop" and uses as command.
Comment 4 Kai Wüstermann 2015-08-20 08:14:07 UTC
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

export LC_ALL=de_DE.UTF-8

=> Should this bug be a feature request?