5

I have Ubuntu 18.04 and Xrdp 0.9.5. I can login directly to local desktop after boot. If I logout, I still can login via Xrdp.

Otherwise, if Xrdp session has opened, even if I closed it, I cannot login to desktop locally, I think Xrdp session is blocking it. I need to restart the machine so I can login locally.

How do I close the Xrdp session?

When I tried to login locally, the log says :

Jul 10 09:34:55 gdm-password]: pam_unix(gdm-password:session): session opened for user superadmin by (uid=0)
Jul 10 09:34:55 systemd-logind[879]: New session 3 of user superadmin.
Jul 10 09:34:57 gdm-password]: pam_unix(gdm-password:session): session closed for user superadmin
Jul 10 09:34:57 systemd-logind[879]: Removed session 3.
Jul 10 09:35:01 CRON[2485]: pam_unix(cron:session): session opened for user root by (uid=0)
Jul 10 09:35:01 CRON[2485]: pam_unix(cron:session): session closed for user root

Restarting the machine is the only way to fix this right now.

UPDATE

After some trial and error, and referenced to @Sylla suggestion, I found that not only Xrdp process to kill, but also XOrg

7313 ?        00:00:02 Xorg
7325 ?        00:00:00 xrdp-chansrv

After that, I can now login locally.

Now the next question is: Is there any chance I could make it automatically kill the processes after I close remote desktop?

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
Asule
  • 71

3 Answers3

1

I did not know that Xrdp has two config file (xrdp.ini & sesman.ini).

So, I created an issue in Xrdp repository here . The developer told me that the configuration is in sesman.ini. The variable named KillDisconnected will do the job. but as I read it, it cannot have less than a value of 60s.

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84
Asule
  • 71
0

I'm a bit late to the party on this one, but was experiencing the very same problem you were with almost the identical setup. I tried just about everything, including different desktops uninstalling and reinstalling gnome desktop, but nothing really worked. The only truly reliable way to login locally was to reboot the computer which wasn't the solution I was after. Quite by accident while using the remote xrdp client, rather than just closing the application from the toolbar as I usually do, I tried logging out of the remote session. Low and behold that did the trick!! I was able to reliably log in locally. So to summarize, logout out of the xrdp session rather than simply closing it. Hope this solution works for you as well.

-1

1) First solution:

ps -u your_username | grep xrdp

will give you the process id.

You can then

kill -9 pid_number

pid refers to your xrdp process ID.

2) Second solution

If you want to close xrdp session, you can use this command

/etc/init.d/xrdp stop

And if you decide to use your xrdp:

/etc/init.d/xrdp start

To check which status you have:

/etc/init.d/xrdp status

Sylla
  • 99