How to disable popup prompt for password in xrdp session? IOW, how to convince Ubuntu that my XRDP session is the console?

I have a dual boot system, Win10 and Ubuntu 20.04. When I boot into Linux, or if I use Hyper-V with enhanced session off, I don’t get prompted for my password, except at login, or after the screen locks.

However, most times that I use the Linux system is via Hyper-V enhanced session, which appears to connect via XRDP. In this mode, I get prompted for my password a lot. Sometimes half a dozen times for "refreshing the system repositories" and then again because "the login keyring did not get unlocked…" when starting up some apps.

From my research, it appears that this is because Ubuntu sees me (correctly!) as not logged in at the console. Is there a good way to tell Ubuntu to treat XRDP sessions as if they were the console session? Or other good way to globally eliminate these popups?

Asked By: tastewar

||

This is a known behavior and it’s triggered by the polkit software solution…

To fix your issue, you have to create exception rules that will be applied when connecting remotely via xRDP software…

To keep it short, create a file in /etc/polkit-1/localauthority/50-local.d/ and name it 45-allow-colord.pkla

in this file, copy the following code

[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes

To fix your specific issue about system repositories refresh, you will need to create also another file that you can name 46-allow-update-repo.pkla (in the same directory as specified above i.e. /etc/polkit-1/localauthority/50-local.d/)

[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Hope this help
Till next time
See ya

Answered By: Griffon

In regards to tasteware’s question about "is there a way for an ordinary user to figure this out? It sure would be handy if, for instance, the popup had a little triangle that when you clicked it expanded the window to show what Action was being questioned."

You can see a log of what actions caused any recent password prompts with:

cat /var/log/auth.log

In Ubuntu 22.04, I also had to add these actions to 46-allow-update-repo.pkla (separated with a semicolon):

org.debian.apt.update-cache

org.debian.apt.upgrade-packages

Answered By: George K
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.