Local ubuntu desktop cannot login after logging in remotely via Xrdp session

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

Asked By: John Bolton

||

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

Answered By: Raffa

Although this is not an answer this may help someone following the answer from @Raffa above.
I followed the answer from Raffa and I could not get it to work I kept getting this error:

this error

In the end the error for me was that I was trying to connect from a computer with multiple screens to a remote computer with one screen and "Use all my monitors" was checked in my RDP client see here:

see here

When I unchecked it it worked.
Hope this helps someone.

Answered By: ylitc
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.