7

I am connecting to a new install of Ubuntu 12.04 via remote desktop (after installing xrdp). Everything seems to work fine except that the keyboard mapping is for US rather than UK.

I have looked at the keyboard layout settings and it shows 'us' being available but no other languages. If I try to add another layout there seems none available.

Logging in on the machine itself shows English (UK) as the locale and if I try to add a new language it shows them all being available.

I have tried both ubuntu-2d and gnome-classic.

Can anyone shed some light on this?

5 Answers 5

13

I have exactly the same problem when connecting to a remote instance on AWS. It seems to be related to xrdp. See for instance this thread, which describes a detailed work-around.

EDIT: Took me a while to get back to this, but since there has been no further activity in this thread, I finally got around to add details as suggested (demanded?) in the comments.

These are the steps I had to do to fix the keyboard layout in xrdp in Ubuntu 12.04. The original link was a big help, but a bit out-dated. I also found useful information with the rdesktop project, for finding country codes: here and here.

  1. Open console and set xkb map to correct model & layout.

    setxkbmap -model pc105 -layout no
    

    Replace model and layout language code to whatever is the correct one for you. I just ran setxkbmap -print on the client PC (which incidently also runs Ubuntu 12.04) to get an idea about these values. Note that setxkbmap needs to have a display to run. You can either run the console through a RDP session or perhaps even login through ssh with X display redirection, like this ssh -X <server>.

  2. Generate XRDP keymap file:

    xrdp-genkeymap km-0414.ini
    sudo mv km-0414.ini /etc/xrdp
    sudo chown root:root /etc/xrdp/km-0414.ini
    

    Replace the country code 0414 with the correct code for your country. See the rdesktop doc to find the correct code for you.

  3. Restart the xrdp service:

    sudo service xrdp restart
    
2
  • Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Jan 4, 2013 at 2:41
  • 1
    Useful indications. I have precisely the same problem: Ubuntu 12.04.4 properly configured with fr-CA keyboard, but when I xrdp from Windows, I'm stuck with an en-US keyboard. And since setxkbmap yields "XKB extension not present", it can't be fixed from there. I ended up using xrdp-genkeymap to generate km-0c0c.ini, and then I renamed km-0409.ini (the en-US keyboard) to km-0409.ini.true as a backup and copied km-0c0c.ini to km-0409.ini. My xrdp session still thinks it's running en-US, but I fooled it into running fr-CA. This will do until a proper solution becomes known.
    – Urhixidur
    Feb 26, 2014 at 20:47
5

I had the same problem, and in my case, just running:

setxkbmap 

without any option, fixed the issue

3

Also had this problem but fixed it by running the following command in the console:

setxkbmap ua

This is for the ukrainian keyboard mapping. Select the language that is present on your keyboard. My keyboard is connected via VNC. It also works on CentOS 7. The answer was found here: https://askubuntu.com/a/580428/644928

UPDATE Not working special characters such as "# @". The following command helped:

setxkbmap ua -model pc105

UPDATE I use Windows RealVNC to connect to the СentOS. Centos are only set to English. Windows has Ukrainian and English. The language switches only in Windows and it passed to Linux. The problem with the language/keyboard mapping was until i changed to remote control on linux from TigerVNC to TurboVNC.

2

I've been fighting this for over a year, it turned out the solution was easy. Until this if I typed asdf I got abfh in some X apps, the occasional few would work just fine.

Uninstall tightvncserver and install vnc4server (you probably also want to do the same with the viewers). Viola, problem disappeared.

1
  • The same. The problem with the keyboard mapping was until i changed the remote control on linux from TigerVNC to TurboVNC.
    – snex
    Dec 11, 2019 at 9:41
1

I'm a bit of a newbie so this may only be relevant for later versions of Ubuntu (I'm on 17.04) or perhaps XOrg/Xfce but the solutions by seb and Steinar only worked temporarily for me, as soon as I logged out then back into an RDP session the keyboard would reset to US.

I found the solution at the bottom of this Getting x11rdp working on Debian 8 while targeting Debian worked for me (you may need to sudo as necessary):

wget https://www.dropbox.com/s/rtxp19ts17k8qy8/km-0809.ini
cp km-0809.ini /etc/xrdp/

sed -i '/\[default_rdp_layouts\]/a rdp_layout_gb=0x00000809' /etc/xrdp/xrdp_keyboard.ini

sed -i '/\[default_layouts_map\]/a rdp_layout_gb=gb' /etc/xrdp/xrdp_keyboard.ini

Now each time I log in, keyboard is set to en-gb and " and @ work as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .