远程桌面连接在连接到WSL/Ubuntu 20.04 LTS时崩溃



我正在尝试在WSL中为Ubuntu 20.04运行XFCE桌面环境(不是WSL2,fyi。我的笔记本电脑不支持虚拟化(。

我已经使用sudo apt install <package-name>安装了xrdpxfce4xubuntu-desktop

我还重新检查过,甚至使用sudo service xrdp statussudo service xrdp restart重新启动了xrdp服务。服务似乎正在运行。

但是,当尝试使用Remote Desktop Connection(mstsc(连接到远程桌面时,它会建立连接,似乎可以确认身份验证是正确的,并简单地关闭(没有显示桌面(。

这是xrdp.log的日志

[20210409-13:25:26] [INFO ] connected client computer name: XXXXXXXXXXXXXX
[20210409-13:25:26] [INFO ] Non-TLS connection established from ::ffff:172.20.10.2 port 52251: encrypted with standard RDP security
[20210409-13:25:27] [DEBUG] xrdp_00002395_wm_login_mode_event_00000001
[20210409-13:25:27] [INFO ] Cannot find keymap file /etc/xrdp/km-00020409.ini
[20210409-13:25:27] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini
[20210409-13:25:27] [WARN ] local keymap file for 0x00020409 found and doesn't match built in keymap, using local keymap file
[20210409-13:25:33] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20210409-13:25:34] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20210409-13:25:34] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20210409-13:25:34] [DEBUG] return value from xrdp_mm_connect 0
[20210409-13:25:34] [INFO ] xrdp_wm_log_msg: login successful for display 10
[20210409-13:25:34] [DEBUG] xrdp_wm_log_msg: started connecting
[20210409-13:25:38] [DEBUG] Closed socket 16 (AF_UNIX)
[20210409-13:25:38] [INFO ] lib_mod_log_peer: xrdp_pid=9109 connected to X11rdp_pid=9112 X11rdp_uid=1000 X11rdp_gid=1000 client_ip=::ffff:172.20.10.2 client_port=52251
[20210409-13:25:38] [DEBUG] xrdp_wm_log_msg: connected ok
[20210409-13:25:38] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20210409-13:25:38] [DEBUG] Closed socket 15 (AF_INET6 ::1 port 52252)
[20210409-13:25:41] [INFO ] The following channel is allowed: rdpdr (0)
[20210409-13:25:41] [INFO ] The following channel is allowed: rdpsnd (1)
[20210409-13:25:41] [INFO ] The following channel is allowed: cliprdr (2)
[20210409-13:25:41] [INFO ] The following channel is allowed: drdynvc (3)
[20210409-13:25:41] [DEBUG] The allow channel list now initialized for this session
[20210409-13:25:46] [DEBUG] Closed socket 17 (AF_UNIX)
[20210409-13:25:46] [DEBUG] Closed socket 11 (AF_INET6 ::ffff:172.20.10.2 port 3389)
[20210409-13:25:46] [DEBUG] xrdp_mm_module_cleanup
[20210409-13:25:46] [DEBUG] Closed socket 16 (AF_UNIX)

我尝试过使用127.0.0.1172.20.10.2进行连接,这两种方法都会产生相同的结果。

我也尝试过像在互联网上看到的那样编辑/etc/xrdp/startwm.sh(注释掉最后两行并添加startxfce4(。这似乎没有什么区别。

p.S请不要推荐使用XLaunchXMing或类似的本地Xserver应用程序的解决方案。这些确实很成功,但我选择使用RDP是有特殊原因的

提前谢谢。

添加到已接受的答案中,如果行test -x /etc/X11/Xsession && exec /etc/X11/Xsession已被取消注释,但RDP连接崩溃,则对现有行进行注释并添加新行startxfce4。因此文件/etc/xrdp/startwm.sh的最后一行应该是:

# test -x /etc/X11/Xsession && exec /etc/X11/Xsession
# exec /bin/sh /etc/X11/Xsession
startxfce4

我通过取消注释命令解决了这个问题#exec /bin/sh /etc/X11/Xsession通过打开文件sudo nano /etc/xrdp/startwm.sh

最新更新