AlmaLinux / cloud-images

Packer templates and other tools for building AlmaLinux images for various cloud platforms.
MIT License
146 stars 48 forks source link

[9.1][XRDP] Keyboard Input Language switch is ignored. Always prints in English #138

Closed apivovarov closed 8 months ago

apivovarov commented 1 year ago

I connected to the AlmaLinux using XRDP (Remote Desktop) I added additional input language in Gnome Settings - Keyboard - Input Sources - + - Russian I switched to "ru" language using language indicator in the top bar and typed some text - the text is still typed in English So, the language switching is ignored in xrdp session

Smth wrong in XRDP keyboard layout settings or xrdp integration with AlmaLinux. Other distributions works fine - switching language in xrdp session works - I tried RHEL9, Rocky 9, Fedora 36.

AMI: ami-038f82869d88a1a4a

Installed software:

sudo dnf install yum-utils
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release
sudo dnf upgrade

sudo dnf group install Workstation
sudo systemctl set-default graphical
sudo reboot

sudo dnf install xrdp
sudo systemctl start xrdp
sudo systemctl enable xrdp

sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --permanent --zone=public --add-service=rdp
sudo systemctl restart firewalld
apivovarov commented 1 year ago

Yes, we have a solution!!!

We need to uncomment [Xorg] block in xrdp.ini.

Step by Step instructions:

## install xorgxrdp
sudo dnf install xorgxrdp

## edit /etc/xrdp/xrdp.ini
sudo vi /etc/xrdp/xrdp.ini

## Uncomment [Xorg] block to Enable it.

[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20

## We can keep [Xvnc] block enabled.

# Save the file and Restart xrdp service
sudo systemctl restart xrdp

## Done!
When you connect to the server in Remote Desktop it will ask for login/password.
Make sure Xorg session is selected - it should be the first in the list. 
Do NOT select Xvnc!

Now the Input Language switch works correctly in Remote Desktop / Xorg / GNOME session!

Tested on Fedora 36, AlmaLinux 9, CentOS Stream 9, CentOS 7

The solution was found by ZOTOVP on Mar 2023 - the article

Related discussion on Fedora forum

LKHN commented 1 year ago

@apivovarov I just assigned it to myself for reproducing the issue. Thanks a lot for the update and saving my time! :)

As I see, what you did is switching the backend from Xvnc to Xorg. Have you seen this? - https://github.com/neutrinolabs/xrdp/wiki/Example-of-xrdp_keyboard.ini-for-russian-keyboard

Maybe it works with Xvnc backend too?

Thanks!

apivovarov commented 1 year ago

I think I tried it before and it did not help.

BTW, do you know why RHEL-like disros have [Xorg] block commented out in xrdp.ini and xorgxrdp is not installed automatically asxrdp dependency?

I checked Ubuntu 22.04 and Debian 11 - they have both [Xorg] and [Xvnc] blocks enabled in xrdp.ini out of the box. xorgxrdp is also automatically installed. This is why Input Language switch works fine in Ubuntu out of the box in Remote Desktop. Xorg session is the first in the list of sessions and selected by default when client connects to the server using Remote Desktop.

LKHN commented 1 year ago

Note that xorgxrdp is not installed and configured by default. Each build depends on specific binary version of Xorg, which tends to create very strict installation dependencies that can be an inconvenience in EPEL.

See: https://src.fedoraproject.org/rpms/xrdp/blob/epel9/f/README.Fedora#_17

LKHN commented 1 year ago

I am adding our community member @metalefty to this discussion, who is a xrdp developer.

@metalefty It would be nice to hear your opinions about the using xrdp on AlmaLinux OS.

metalefty commented 1 year ago

Hi, usually, we xrdp developers use xorgxrdp rather than Xvnc backend because it is more integrated in keyboard handling. However, we have implemented some (formerly xorgxrdp only) features such as dynamic resizing. So now Xvnc is a good alternative to xorgxrdp. Either is fine. As mentioned in Fedora README, a disadvantage of xorgxrdp is, it sticks to Xorg. It will sometimes be broken right after Xorg update in each EL OS.

Regarding original reporter's issue, I don't think there's any difference between Rocky 9 and AlmaLinux 9. Let me some time to test.

metalefty commented 1 year ago

EPEL and xrdp team both have a packaging issue https://github.com/neutrinolabs/xrdp/issues/2687. I'll test it after the fixed version comes out. It will be soon.

LKHN commented 1 year ago

@metalefty Many thanks for the detailed explanation! Tracking the linked issue, let's see how it goes. It would be great have a robust RDP server support on AlmaLinux OS.

I am eagerly looking forward to use and suggest it as an alternative to VNC. :smile:

metalefty commented 10 months ago

I don't think this issue is distro specific because xrdp is installed from EPEL and Alma was 1:1 clone of RHEL at the time.

beremour commented 2 months ago

Rocky 9.3. Same issue.

metalefty commented 2 months ago

Yes we know. The fact you have the same issue on Rocky proves that the issue is not AlmaLinux cloud-image issue and it also proves here's not the place to report it.