Article 6PC0N Ubuntu in WSL2 - XRDP service will stop seconds after remote connection

Ubuntu in WSL2 - XRDP service will stop seconds after remote connection

by
Cougar!
from LinuxQuestions.org on (#6PC0N)
To find out how well I can migrate to Linux, I tried to run Ubuntu desktop on WSL2 first. I've disabled WSLg, installed XRDP and used a port 12345 in xrdp.ini, then allowed connection to this port in firewall. On Windows host I could then use mstsc.exe to connect to localhost:12345 to run a full desktop environment on Ubuntu.

Or so I thought it would be the case... Merely tens of seconds after successful connection, the remote session would be disconnected and I couldn't connect to localhost:12345 anymore without running Code:sudo systemctl restart xrdpIt seems that XRDP service was terminated. Strangely this does not always happen -- normally 4-5 times of failed connection attempt after WSL restart, the connection will become stable.

I have looked at the service log via sudo journalctl -u xrdp.service and didn't find any mentioning of XRDP service being stopped, but mentioning of XRDP service being started by systemd the moment when my remote connection goes lost (the example below - 16:18:48)

Code:Jul 20 16:18:30 PCNAME xrdp[967]: [INFO ] connected ok
Jul 20 16:18:48 PCNAME systemd[1]: Starting xrdp.service - xrdp daemon...
Jul 20 16:18:48 PCNAME xrdp[655]: [INFO ] address [0.0.0.0] port [12345] mode 1
Jul 20 16:18:48 PCNAME xrdp[655]: [INFO ] listening to port 12345 on 0.0.0.0
Jul 20 16:18:48 PCNAME xrdp[655]: [INFO ] xrdp_listen_pp done
Jul 20 16:18:48 PCNAME systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: No such file or>
Jul 20 16:18:49 PCNAME systemd[1]: Started xrdp.service - xrdp daemon.
Jul 20 16:18:50 PCNAME xrdp[661]: [INFO ] starting xrdp with pid 661
Jul 20 16:18:50 PCNAME xrdp[661]: [INFO ] address [0.0.0.0] port [12345] mode 1
Jul 20 16:18:50 PCNAME xrdp[661]: [INFO ] listening to port 12345 on 0.0.0.0
Jul 20 16:18:50 PCNAME xrdp[661]: [INFO ] xrdp_listen_pp doneWhat would cause the frequent service restart of XRDP in Ubuntu?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments