xrdp - how to change keyboard layout

46,020

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 .

Share:
46,020

Related videos on Youtube

yildizabdullah
Author by

yildizabdullah

Updated on September 18, 2022

Comments

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