ubuntuwindows-subsystem-for-linuxrdpxfcexrdp

Remote Desktop Connection crashing when connecting to WSL/Ubuntu 20.04 LTS


I am trying to run XFCE Desktop Environment for Ubuntu 20.04 in WSL (not WSL2, fyi. My laptop does not support virtualisation).

I have installed xrdp, xfce4 and xubuntu-desktop using sudo apt install <package-name>.

I have also rechecked, and even restarted the xrdp service using sudo service xrdp status and sudo service xrdp restart. The service does seem to be running.

But upon trying to connect to the Remote Desktop using Remote Desktop Connection(mstsc), it establishes a connection, seems to confirm that the authentication is correct and simply closes (no desktop is shown).

Here's the log from 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)

I have tried connecting using 127.0.0.1 as well as 172.20.10.2, both which yield same result.

I have also tried editing the /etc/xrdp/startwm.sh like I saw in the Internet (Commenting out the last two lines and adding startxfce4). It doesn't seem to be making any difference.

P.S Please do not recommend solutions of using XLaunch, XMing or such similar local Xserver apps. Those do work succesfully, but I am choosing to go for RDP for specific reasons.

Thanks in advance.


Solution

  • I solved the issue by uncommenting the command #exec /bin/sh /etc/X11/Xsession by opening file sudo nano /etc/xrdp/startwm.sh