Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed xrdp on my Linux FC 17 KDE server, so that I can use mstsc from Windows to connect to it.

All works really well, except that I have a Swiss keyboard, and when I type say a Z, I get a Y on the screen (Swiss is QWERTZ and not QWERTY).

I installed Linux on the server while a Swiss keyboard was attached to it. Locally it works fine.

I tried adding a Swiss layout in the window called "Keyboard - KDE Control Module", but that doesn't help.

I use the same user, whether logging in locally or remotely.

How do I fix this problem?

share|improve this question
Please log on to the server, open a terminal and post the output of this command: echo $LANG – terdon Jan 16 '13 at 21:05
en_US.UTF-8 - that's wrong! What do I do now? :-) – Ant Kutschera Jan 16 '13 at 21:09
@AntKutschera Buy a US keyboard? ;-) – weberc2 Jan 16 '13 at 21:11

Since you saw that the $LANG variable is wrong, you should try setting it in your ~/.bashrc.

Sorry, spoke too soon, and did not think. The $LANG variable controlls all aspects of your locale, not the keyboard layout as such. As far as I can tell, the easiest fix for this would be to add this line to your ~/.bashrc:

setxkbmap -layout de_CH

Now, I am not at all sure that is the correct name for the swiss layout you are using. I had a look around and this page suggests either de_CH or fr_CH. However, neither works on my system but that might be just because I don't have the relevant layouts. Play around with setxkbmap just open a terminal and try out some layouts:

setxkbmap -layout de_CH
setxkbmap -layout fr_CH

etc etc.

You can have a look at some locale names at /usr/share/i18n/locales/, maybe you can identify the one you need :).

share|improve this answer
doesnt work :-( I set it, reboot, logged in remotely, checked the LANG variable which now reads de_CH.UTF-8 (Swiss German variant), but the keyboard is working the same as before :-( – Ant Kutschera Jan 16 '13 at 21:21
All it did was to make my shell output german error messages :-) – Ant Kutschera Jan 16 '13 at 21:27
Yeah, sorry, see my updated answer. – terdon Jan 16 '13 at 21:33
The setxkbmap doesnt work for me either. I am getting a bit further with this: The first part (creating the file and putting it under /etc/xrdp and then rebooting works, but there are quite a few differences between my thinkpad T410 keyboard and that one. are there any graphical tools which I can use where I can click a key and see its code? – Ant Kutschera Jan 16 '13 at 22:15
setxkbmap really should work... You just have to figure out the correct layout name. Have you tried a german german layout, as opposed to a swiss one? This command gives me a QWERTZ kezboard: setxkbmap -layout de – terdon Jan 16 '13 at 22:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.