As mentioned in Ubuntu 22.04 remote desktop headless? :
It looks like gnome-remote-desktop runs as a user service, not a system service, so it's not active unless the user logs in. And it starts before the keyring is unlocked, so it creates a new password every time it starts.
So I looked up gnome-remote-desktop
, and found https://wiki.gnome.org/Projects/Mutter/RemoteDesktop -> and from there, https://www.mankier.com/1/grdctl
Right after boot, this tools confirms that gnome-remote-desktop
is running:
$ grdctl status
RDP:
Status: enabled
TLS certificate: /home/user/.local/share/gnome-remote-desktop/rdp-tls.crt
TLS key: /home/user/.local/share/gnome-remote-desktop/rdp-tls.key
View-only: no
Username: (empty)
Password: (empty)
VNC:
Status: enabled
Auth method: prompt
View-only: no
Password: (empty)
... so I guess the problem is the keyring.
I've tried the unlock-keyring
bash script from https://unix.stackexchange.com/questions/602313/unlock-gnome-keyring-daemon-from-command-line/676655#676655 ; it did not work
Then I tried the .config/autostart/password_fix.desktop
from Ubuntu 22.04 remote desktop headless? -> this actually DID work, however right after boot, you get a prompt to enter your password to unlock the keyring, and since this is a PC without keyboard or mouse, it is a PAIN to do that every time; but at least, once that is done, I can get a remote connection over RDP with the login and password I expect.
So the final thing is - how to get rid of that keyring password prompt at start; https://unix.stackexchange.com/questions/684412/is-it-possible-to-permanently-disable-the-gnome-keyring-passphrase notes:
A partial solution to this problem is to set the keyring password to an empty string, by opening the Passwords and Keys app (type keyring into the search bar), and using the menu as below: ...
But is not a very good solution, because the keyring password keeps being reset, and you have to repeat the same process all over again. I am not sure if this happens on some reboots, or when there has been an update.
So, blank password is not really an option either - but eventually, I got to this:
(Remove/disable .config/autostart/password_fix.desktop
from above, if used)
Copy the script unlock_keyring.sh
from https://unix.stackexchange.com/questions/602313/unlock-gnome-keyring-daemon-from-command-line/602935#602935 on the remote PC; do NOTE that it says: "NOTE: This script will only work if launched via source or ."
Upon fresh reboot of the remote PC, login via ssh
, and then:
- Call
unlock_keyring.sh
via sourcing:
$ . unlock_keyring.sh
NOTE: This script will only work if launched via source or .
Login password:
$
- Call the
python3
command, originally in .config/autostart/password_fix.desktop
:
$ python3 -c "import keyring;keyring.set_password('login','user','Remmina_Password');"
$
At this point, I can log in over Remmina/RDP to the remote PC - without having to do any GUI operations ...