Linux – Remote desktop Windows -> Linux. How to use Linux keyboard layout

colemakkeyboard-layoutlinuxremote desktopwindows

I log in to an unprivileged windows 10 machine, but do most of my work on a remote desktop connection to a virtual linux installation.

I use the standard Remote Desktop that comes with windows and on the Linux end I get a login screen from xrdp before I get my Centos 7 desktop. I can sudo to root in Centos.

I'd like to use colemak on the linux box, but the keyboard layout from my local windows machine takes precedence.

Adding colemak on Centos was easy using the system settings, but no matter which layout I pick in Linux, the layout from the hosting windows machine "wins".

Chosing US layout or any other layout is also ignored. So this questions is applicable too if you replaced any national layout with colemak.

I have seen the opposite question asked a number of times (make local layout win), but I can't find the answer to my problem. Many answers to the opposite problem revolves around adding a registry key to ignore the host layout. But that key does not exist on my windows machine (and I doubt if I can change the registry settings).

Best Answer

The trouble is that Xrdp doesn't seem to support X windows keyboard mappings properly.

It is an old problem discussed from 2012 and still patched somehow in the same way in 2019 (read the comments of the previous link).

In your case, since remote desktop takes the precedence, it seems logic to install the proper layout (colemak) on the windows machine and switch to that to use it in the virtual environment too. Since you are not in the possibility to install any driver I see only a couple of solutions:

  1. If you can install some program for the current user, you may try to use another program to connect with your emulated environment, choosing one that allows you to select the host keyboard layout. I remember that No Machine worked well once...you can try it (there is a free version too).

  2. To remap the keyboard inside Linux. From the this link you can download a file (km-0809.ini) with some mapping already made, and modify it for your purposes.

    sudo chown xrdp.xrdp /etc/xrdp/km-0809.ini 
    sudo chmod 644 /etc/xrdp/km-0809.ini
    sudo service xrdp restart
    
Related Question