5

I login remotely to my PC (Ubuntu 18.04, XRDP 0.9.5) from my laptop (Windows 10) using windows remote desktop. Once I have logged in remotely to Ubuntu, I cannot login locally to it (for times when I am physically in the lab). Locally, I see the login screen and enter my password but the login screen appears again without any error messages. I then have to logout from my remote session (which kills any experiments I am doing) in order to login locally and this works fine. The problem is that I have to logout from my remote session and this is not an ideal situation for me. The reverse is also true [if logged in locally, I am unable to login remotely. I get a connection, enter my password but nothing happens, no error messages even].

Is there a solution to this problem. The closest post I could find was this but I don't understand what this guy did. Appreciate the help. Thanks

2 Answers2

5

By default xrdp will create a new session when you remotely connect and the local user must be logged out first for this to work or otherwise you will see a blank screen when you connect remotely.

To have xrdp log you in to the existing active logged-in local session instead, follow these steps:

First, enable screen sharing in Ubuntu settings and set a password.

Then, edit /etc/xrdp/xrdp.ini like so:

sudo nano /etc/xrdp/xrdp.ini

Then, copy and paste the following at the end of the file:

[xrdp1-loggedin]
name=Local Active Session
lib=libvnc.so
username=na
password=ask
ip=127.0.0.1
port=5900

Then, save the file and close the editor by pressing Ctrl + x then y then Enter

Finally, you might need to disable password encryption (A security hazard but might be required to allow connections from clients that don’t support it) by running in the terminal:

gsettings set org.gnome.Vino require-encryption false

Notice that in Ubuntu 22.04, Unfortunately, encryption can only be disabled if you disable encryption for all passwords in the keyring by setting a blank password for keyring login.

Next, login locally then connect from a remote machine and choose Local Active Session from the Session drop-down menu when you see this screen:

enter image description here

Then, enter the password you set for screen sharing and click the OK button when you see the password field that looks like this:

enter image description here

Raffa
  • 32,237
  • thank you @Raffa for a very detailed answer. I tried it when I was able to go to the lab physically and it worked as described. However I would like to point out that there were 2 scenarios which i had thought would have identical solutions, but it turns out that they are not identical. – John Bolton Apr 02 '21 at 21:36
  • Logged in Locally -> Try to log in Remotely via XRDP -- This solution works [login via the newly created Local Active Session].
  • – John Bolton Apr 02 '21 at 21:36
  • Logged in Remotely -> Try to log in Locally -- Doesn't work [with fair reason that this procedure modifies xrdp, while it would require some way to modify the local login].
  • – John Bolton Apr 02 '21 at 21:36
  • For me this solution is unfortunately not working when connection from Windows 10 RDP to Ubuntu Desktop 22.04. After entering the password for "Local active sessioin" and pressing OK button nothing happens and the window asking for password stays there without any change. I am not sure if there is password encryption on my Ubuntu, because Seahorse is not installed. – Ivaylo Jan 14 '24 at 14:16