When I open an xrdp session from a Windows 7 machine to my Ubuntu machine, US keyboard layout is utilized. However, my default keyboard layout is different on Ubuntu machine and I want to use it during xrdp sessions. How can I fix this?

  • Which keyboard layout would you like to set? Check askubuntu.com/a/593944/385763 – Yasel Mar 7 '15 at 19:27
  • I am still working on that, too. This should be a good starting point ➝ c-nergy.be/blog/?p=3858 – Frank Nocke Feb 14 '16 at 17:15
  • What I'm noticed is that even now on Windows 10 with pre-configured Ubuntu 18 image from Hyper-V keyboard layout switching sometimes stops working on Hyper-V VM with Ubuntu from time to time, for example when it resumes after Hyper-V host reboot... In that case issue does not goes away until I reboot VM. – Mikhail Oct 23 '19 at 7:16

if you have installed xrdp, you should have te xrdp-genkeymap installed on your system. the utility will be located under /etc/xrdp folder

To change keyboard layout, you need indeed to issue the xrdp-genkeymap command. The command has to be run locally on the ubuntu machine and not from the xrdp session.
issue the following command to use us layout keyboard during your xrdp session sudo xrdp-genkeymap /etc/xrdp/km-0409.ini

If you need other language layout, you have to find the correct km-xxx.ini file

Hope this help Till next time see ya


I'd like to contribute here, since there seems to be little instructions.

Find the language / keyboard input you need from here

So for example fr-be French (Belgium) is 080C.

Then run these commands to generate the keyboard mapping for your chosen input.

xrdp-genkeymap km-080C.ini

To copy it in the xrdp folder

sudo mv km-080C.ini /etc/xrdp

Remember that you must change the permissions of the file, so that it can be used

sudo chown root:root /etc/xrdp/km-080C.ini

Restart the service and it should work

sudo service xrdp restart
  • 1
    Thankyou Enrico, this issue had been driving me crazy for hours - the extra explanation and info is great – Oliver Dungey Apr 25 '18 at 16:00
  • I got a crash when restarting the service, probably because now services are managed using systemd. In this case, what worked for me is sudo systemctl restart xrdp – Dr. Windows Jul 16 '19 at 12:11

for me it was enough to run next command, in order to set the right keyboard map in X

setxkbmap be

where you must replace the "be" with your land code. You can see the current value with

setxkbmap -query

Try to locally run this code not from xrdp session :

xrdp-genkeymap /etc/xrdp/km-0409.ini

Restart xrdp and try .

  • There is no xrdp-genkeymap command on my system. – yildizabdullah Jan 30 '14 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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