neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.6k stars 1.73k forks source link

misconfigured keyboard, when pressing the "/" key #3228

Open wendelsilva opened 2 weeks ago

wendelsilva commented 2 weeks ago

xrdp version

0.10.1

Detailed xrdp version, build options

xrdp 0.10.1
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2024 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --build=x86_64-redhat-linux-gnu
      --host=x86_64-redhat-linux-gnu
      --program-prefix=
      --disable-dependency-tracking
      --prefix=/usr
      --exec-prefix=/usr
      --bindir=/usr/bin
      --sbindir=/usr/sbin
      --sysconfdir=/etc
      --datadir=/usr/share
      --includedir=/usr/include
      --libdir=/usr/lib64
      --libexecdir=/usr/libexec
      --localstatedir=/var
      --sharedstatedir=/var/lib
      --mandir=/usr/share/man
      --infodir=/usr/share/info
      --enable-fuse
      --enable-pixman
      --enable-painter
      --enable-vsock
      --enable-ipv6
      --with-socketdir=/run/xrdp
      --with-imlib2
      build_alias=x86_64-redhat-linux-gnu
      host_alias=x86_64-redhat-linux-gnu
      CC=gcc
      CFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
      LDFLAGS=-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1
      CXX=g++
      CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
      LT_SYS_LIBRARY_PATH=/usr/lib64:
      PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig

  Compiled with OpenSSL 3.0.7 1 Nov 2022

Operating system & version

Red Hat Enterprise Linux 9

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

Xvnc TigerVNC 1.13.1

What desktop environment do you use?

GNOME

Environment xrdp running on

VM

What's your client?

No response

Area(s) with issue?

Other

Steps to reproduce

I installed xrdp with ansible on a rhel 9 vm and after connecting to the vm with rdp from a windows computer, the "/" key on my keyboard is not working, the key is not written and instead increases the volume of the vm, I am using an ABNT2 keyboard with Brazilian Portuguese language on the system

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Anything else?

No response

matt335672 commented 2 weeks ago

@wendelsilva

This thread has just been spammed by a user @scheichreisuli. The post and user have now disappeared.

This post was nothing to do with us.

matt335672 commented 2 weeks ago

Thanks for opening this @wendelsilva

Since you're using the VNC backend, I'm pretty confident we can finds a solution for you.

With the VNC backend, the keyboard mappings are all contained in a single file, which for your system is probably /etc/xrdp/km-00000416.ini

Can we verify this first? Please give me the output of this commasnd on your system:-

sudo grep /etc/xrdp/km- /var/log/xrdp.log

Once we've got the right file, we'll need to modify the lines in it which correspond to the '/' key.

According to https://www.kbdlayout.info/kbdbr/overview+scancodes, the scancode from the slash key on an ABNT2 keyboard is 0x73. On this version of xrdp, this maps to key index 123. So the lines we need to modify in the file all start with Key123=

When you've confirmed the keyboard I'll be able to tell you what changes to make to the file.

wendelsilva commented 1 week ago

Here is the return for the command

[2024-09-02T08:15:29.920-0300] [INFO ] Loading keymap file /etc/xrdp/km-00010416 .ini [2024-09-02T09:16:51.371-0300] [INFO ] Loading keymap file /etc/xrdp/km-00010416 .ini [2024-09-03T08:08:49.473-0300] [INFO ] Loading keymap file /etc/xrdp/km-00010416 .ini [2024-09-04T08:03:48.771-0300] [INFO ] Loading keymap file /etc/xrdp/km-00000416 .ini

matt335672 commented 1 week ago

That's interesting.

There are four connections shown here. Looking at [MSFT-DIL], the first three are using a keyboard layout of 00010416 ("Portuguese (Brazilian ABNT2)") and the fourth is using a keyboard layout of 00000416 ("Portuguese (Brazilian ABNT)")

We may have to modify a couple of files here.

Regarding the last question, the output of these commands might help:-

rpm -qf /etc/xrdp/km-00010416.ini
rpm -qf /etc/xrdp/km-00000416.ini
ls -il /etc/xrdp/km-*0416.ini
cksum /etc/xrdp/km-*0416.ini

Thanks.

wendelsilva commented 1 week ago

Sending command results

rpm -qf /etc/xrdp/km-00010416.ini
# o arquivo /etc/xrdp/km-00010416.ini não pertence a nenhum pacote

rpm -qf /etc/xrdp/km-00000416.ini
# xrdp-0.10.1-1.el8.x86_64

ls -il /etc/xrdp/km-*0416.ini
# 16971168 -rw-r--r--. 1 root root 9168 jul 31 09:55 /etc/xrdp/km-00000416.ini
# 16971438 -rw-r--r--. 1 root root 9440 ago 22 10:07 /etc/xrdp/km-00010416.ini

cksum /etc/xrdp/km-*0416.ini
# 219370753 9168 /etc/xrdp/km-00000416.ini
# 2297189319 9440 /etc/xrdp/km-00010416.ini
matt335672 commented 1 week ago

Right.

So /etc/xrdp/km-00010416.ini has appeared on your system from somewhere a couple of weeks ago. You've got no idea where it's come from though.

Try this:-

  1. Make copies of both files somewhere
  2. Edit /etc/xrdp/km-00000416.ini. Find the section [noshift] and under that look for Key123=269025043:0. Replace that line with key123=47:47
  3. In the same file, find the section '[shift]' and under that look for Key123=269025043:0. Replace that line with key123=63:63
  4. Do step 2) for /etc/xrdp/km-00010416.ini
  5. Do step 3) for /etc/xrdp/km-00010416.ini