xrdp - how to change keyboard layout
Solution 1
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
Solution 2
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
Solution 3
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
Solution 4
Unfortunately none of the above answers completely solved my problem.
After looking into directory sudo ls /etc/xrdp/
I found out that .ini
files had more 0 prefixes, so instead I had to do the following, to make it work.
sudo xrdp-genkeymap /etc/xrdp/km-00000424.ini
(Slovenian layout)
and then additionally edit file sudo vi /etc/xrdp/xrdp-keyboard.ini
and add the following lines after each section:
[default_rdp_layouts]
rdp_layout_si=0x00000424
; <rdp layout name> = <X11 keyboard layout value>
[default_layouts_map]
rdp_layout_si=si
[rdp_layouts_map_mac]
rdp_layout_si=si
I hope that helps someone.
Solution 5
Try to locally run this code not from xrdp session :
xrdp-genkeymap /etc/xrdp/km-0409.ini
Restart xrdp and try .
Related videos on Youtube

yildizabdullah
Updated on September 18, 2022Comments
-
yildizabdullah 8 months
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?
-
Yasel about 8 yearsWhich keyboard layout would you like to set? Check askubuntu.com/a/593944/385763
-
Frank Nocke over 7 yearsI am still working on that, too. This should be a good starting point ➝ c-nergy.be/blog/?p=3858
-
Mikhail over 3 yearsWhat 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.
-
-
yildizabdullah over 9 yearsThere is no xrdp-genkeymap command on my system.
-
user8102905 about 5 yearsThankyou Enrico, this issue had been driving me crazy for hours - the extra explanation and info is great
-
Dr. Windows almost 4 yearsI 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
-
sola about 1 yearIMPORTANT: You have to generate the keymap from your normal Ubuntu session, not from under xrdp.