登录 Ubuntu 20.04 远程桌面后鼠标和键盘无法使用

登录 Ubuntu 20.04 远程桌面后鼠标和键盘无法使用

我试图通过 Windows 10 远程控制 Ubuntu 20.04。

我使用以下脚本安装了 xrdphttps://c-nergy.be/

在windows上登录后,屏幕刷新但是鼠标键盘没有反应。

笔记本安装Ubuntu系统,键盘鼠标正常。

这是日志文件。

[20210624-20:53:08] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:53:08] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-20:53:08] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210624-20:53:08] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210624-20:53:08] [DEBUG] TLSv1.3 enabled
[20210624-20:53:08] [DEBUG] TLSv1.2 enabled
[20210624-20:53:08] [DEBUG] Security layer: requested 11, selected 1
[20210624-20:53:08] [INFO ] connected client computer name: HUSKY-K610C
[20210624-20:53:08] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20210624-20:53:08] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20210624-20:53:08] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20210624-20:53:08] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20210624-20:53:08] [INFO ] TLS connection established from ::ffff:: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20210624-20:53:08] [DEBUG] xrdp_00000dc2_wm_login_mode_event_00000001
[20210624-20:53:08] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:53:08] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:53:08] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20210624-20:53:08] [WARN ] local keymap file for 0x00000804 found and doesn't match built in keymap, using local keymap file
[20210624-20:53:08] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20210624-20:53:08] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210624-20:53:08] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210624-20:53:08] [DEBUG] return value from xrdp_mm_connect 0
[20210624-20:53:10] [INFO ] xrdp_wm_log_msg: login failed for display 0
[20210624-20:53:10] [DEBUG] xrdp_mm_module_cleanup
[20210624-20:53:10] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 47924)
[20210624-20:53:25] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20210624-20:53:25] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210624-20:53:25] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210624-20:53:25] [DEBUG] return value from xrdp_mm_connect 0
[20210624-20:53:25] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20210624-20:53:25] [DEBUG] xrdp_wm_log_msg: started connecting
[20210624-20:53:25] [INFO ] lib_mod_log_peer: xrdp_pid=3522 connected to X11rdp_pid=3544 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff
[20210624-20:53:25] [DEBUG] xrdp_wm_log_msg: connected ok
[20210624-20:53:25] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20210624-20:53:25] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 47926)
[20210624-20:55:19] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:55:19] [DEBUG] xrdp_mm_module_cleanup
[20210624-20:55:19] [DEBUG] Closed socket 19 (AF_UNIX)
[20210624-20:55:19] [DEBUG] Closed socket 20 (AF_UNIX)
[20210624-20:55:38] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:59.78.0.91 port 7585
[20210624-20:55:38] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:55:38] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-20:55:38] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210624-20:55:38] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210624-20:55:38] [DEBUG] TLSv1.3 enabled
[20210624-20:55:38] [DEBUG] TLSv1.2 enabled
[20210624-20:55:38] [DEBUG] Security layer: requested 11, selected 1
[20210624-20:55:38] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:55:38] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:59.78.0.91 port 7586
[20210624-20:55:38] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:55:38] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-20:55:38] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210624-20:55:38] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210624-20:55:38] [DEBUG] TLSv1.3 enabled
[20210624-20:55:38] [DEBUG] TLSv1.2 enabled
[20210624-20:55:38] [DEBUG] Security layer: requested 11, selected 1
[20210624-20:55:38] [INFO ] connected client computer name: HUSKY-K610C
[20210624-20:55:38] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20210624-20:55:38] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20210624-20:55:38] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20210624-20:55:38] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20210624-20:55:38] [INFO ] TLS connection established from ::ffff: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20210624-20:55:40] [DEBUG] xrdp_000011c0_wm_login_mode_event_00000001
[20210624-20:55:40] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:55:40] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:55:40] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20210624-20:55:40] [WARN ] local keymap file for 0x00000804 found and doesn't match built in keymap, using local keymap file
[20210624-20:55:46] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20210624-20:55:46] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210624-20:55:46] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210624-20:55:46] [DEBUG] return value from xrdp_mm_connect 0
[20210624-20:55:46] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20210624-20:55:46] [DEBUG] xrdp_wm_log_msg: started connecting
[20210624-20:55:46] [INFO ] lib_mod_log_peer: xrdp_pid=4544 connected to X11rdp_pid=3544 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:
[20210624-20:55:46] [DEBUG] xrdp_wm_log_msg: connected ok
[20210624-20:55:46] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20210624-20:55:46] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 47944)
[20210624-20:55:54] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:55:54] [DEBUG] xrdp_mm_module_cleanup
[20210624-20:55:54] [DEBUG] Closed socket 19 (AF_UNIX)
[20210624-20:55:54] [DEBUG] Closed socket 20 (AF_UNIX)
[20210624-20:59:23] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:59.78.0.91 port 11866
[20210624-20:59:23] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:59:23] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-20:59:23] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210624-20:59:23] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210624-20:59:23] [DEBUG] TLSv1.3 enabled
[20210624-20:59:23] [DEBUG] TLSv1.2 enabled
[20210624-20:59:23] [DEBUG] Security layer: requested 11, selected 1
[20210624-20:59:23] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:59:23] [INFO ] Socket 12: AF_INET6 connection received from ::ffff:59.78.0.91 port 11867
[20210624-20:59:23] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:59:23] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-20:59:23] [INFO ] Using default X.509 certificate: /etc/xrdp/cert.pem
[20210624-20:59:23] [INFO ] Using default X.509 key file: /etc/xrdp/key.pem
[20210624-20:59:23] [DEBUG] TLSv1.3 enabled
[20210624-20:59:23] [DEBUG] TLSv1.2 enabled
[20210624-20:59:23] [DEBUG] Security layer: requested 11, selected 1
[20210624-20:59:23] [INFO ] connected client computer name: HUSKY-K610C
[20210624-20:59:23] [INFO ] adding channel item name rdpdr chan_id 1004 flags 0x80800000
[20210624-20:59:23] [INFO ] adding channel item name rdpsnd chan_id 1005 flags 0xc0000000
[20210624-20:59:23] [INFO ] adding channel item name cliprdr chan_id 1006 flags 0xc0a00000
[20210624-20:59:23] [INFO ] adding channel item name drdynvc chan_id 1007 flags 0xc0800000
[20210624-20:59:23] [INFO ] TLS connection established from ::ffff: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
[20210624-20:59:23] [DEBUG] xrdp_00001823_wm_login_mode_event_00000001
[20210624-20:59:23] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:59:23] [INFO ] Cannot find keymap file /etc/xrdp/km-00000804.ini
[20210624-20:59:23] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20210624-20:59:23] [WARN ] local keymap file for 0x00000804 found and doesn't match built in keymap, using local keymap file
[20210624-20:59:27] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20210624-20:59:27] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210624-20:59:27] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210624-20:59:27] [DEBUG] return value from xrdp_mm_connect 0
[20210624-20:59:27] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20210624-20:59:27] [DEBUG] xrdp_wm_log_msg: started connecting
[20210624-20:59:27] [INFO ] lib_mod_log_peer: xrdp_pid=6179 connected to X11rdp_pid=3544 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:59.78.0.91 client_port=11867
[20210624-20:59:27] [DEBUG] xrdp_wm_log_msg: connected ok
[20210624-20:59:27] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20210624-20:59:27] [DEBUG] Closed socket 18 (AF_INET6 ::1 port 47982)
[20210624-20:59:34] [DEBUG] Closed socket 12 (AF_INET6 ::ffff:192.168.1.112 port 3389)
[20210624-20:59:34] [DEBUG] xrdp_mm_module_cleanup
[20210624-20:59:34] [DEBUG] Closed socket 19 (AF_UNIX)
[20210624-20:59:34] [DEBUG] Closed socket 20 (AF_UNIX)
[20210624-20:59:37] [DEBUG] Closed socket 11 (AF_INET6 :: port 3389)
[20210624-21:01:19] [INFO ] address [0.0.0.0] port [3389] mode 1
[20210624-21:01:19] [INFO ] listening to port 3389 on 0.0.0.0
[20210624-21:01:19] [INFO ] xrdp_listen_pp done
[20210624-21:01:19] [DEBUG] Closed socket 7 (AF_INET6 :: port 3389)
[20210624-21:01:21] [INFO ] starting xrdp with pid 1016
[20210624-21:01:21] [INFO ] address [0.0.0.0] port [3389] mode 1
[20210624-21:01:21] [INFO ] listening to port 3389 on 0.0.0.0
[20210624-21:01:21] [INFO ] xrdp_listen_pp done

答案1

我尝试了其他地方的解决方案来运行:

sudo apt-get install xserver-xorg-input-all

但这似乎不起作用。但是按照这里的解决方案,我在 Xubuntu 20.04 上使用 xfce 成功了:https://github.com/neutrinolabs/xorgxrdp/issues/164#issuecomment-710594486

对我来说,解决方法是将选项“CoreKeyboard”和选项“CorePointer”添加到输入设备中/etc/X11/xrdp/xorg.conf由于 serverlayout 部分中的输入设备显然被忽略,因此不存在核心指针和键盘,这会导致强制默认设备。不知道为什么会突然出现这种情况,它在 ubuntu 18.04 上运行良好,但在 20.04 中对我来说就坏了。

Section "InputDevice"
    Identifier "xrdpKeyboard"
    Driver "xrdpkeyb"
    Option "CoreKeyboard"
EndSection

Section "InputDevice"
    Identifier "xrdpMouse"
    Driver "xrdpmouse"
    Option "CorePointer"
EndSection

答案2

以防万一有人遇到这个问题。在 Debian 12 中,我使用 xrdp 从 Windows 进行连接。当我将“输入设备 > 键盘 > 硬件”中的“启动时数字锁定”设置从“启用”更改为“不更改”时,远程键盘停止工作。当我将其切换回“启用”时,键盘又恢复了。

相关内容