Score:2

Use GNOME Remote Desktop before the very first login

br flag

I already read similar post, like this or this.

I have a remote PC that I turn on from a remote place using a "magic" Wake On LAN packet though (so no direct access to it).

I am currently using the xrdp package to log into my remote PC, but I would like to use the default GNOME Remote Desktop feature included in the new Ubuntu 22.04. Is there a way to reach this goal? I think the problem is that GNOME Remote Desktop is defined like a user service and so it is not possible to activate it before the very first login (after the computer has just booted!).

Anyone has any suggestions on how to accomplish this?

Note: I would prefer to avoid activating the auto-login mechanism.

EDIT: attached image of the error

Remote Desktop Connecton ERROR

Terrible Tadpole avatar
au flag
Are you "sharing" or trying to establish an independent, remote Gnome session? If there is no user logged onto the server then what is being shared?
Nicholas Redi avatar
br flag
I am sharing the GNOME remote desktop connection. After the auto-login , I automatically start a python script that locks my screen, automatically type for me keyboard keys to accomplish login again and once I logged in the user, I can successfully establish the remote connection, sharing exactly that user session.
Score:2
jp flag

Gnome remote desktop(AKA screen sharing) requires a running gnome session and this in turn requires a user logging-in first.

Note: I would prefer to avoid activating the auto-login mechanism.

That is possible but, involves a lot of plumbing.

However, you can just enable automatic login and immediate screen lock either from the settings application and selecting the minimum possible waiting time or you can lock the screen almost instantly by adding a new startup application like this with the xdg-screensaver lock command either on its own like so;

xdg-screensaver lock

Or in an sh command string like this:

sh -c 'xdg-screensaver lock'
Nicholas Redi avatar
br flag
I just tried to do like you said... activated the autologin mechanism then automatically launching the "xdg-screensaver lock" command, but when I try to connect from my windows machine though Remote Desktop Connection I got an ERROR saying somenthing similar to "Cannot connect to the remote machine, please contact the remote machine administrator if the problem persists"... so it seems however that a real login must be accomplished before anyone can connect from a remote host.. so this didn't solve my problem :(
Nicholas Redi avatar
br flag
I can also confirm that the tick doesn't work even if I avoid to lock the screen after the boot ! I edit my question attaching screenshot of Windows Error...
Raffa avatar
jp flag
@NicholasRedi You need to [enable gnome remote desktop](https://help.ubuntu.com/stable/ubuntu-help/sharing-desktop.html.en) first ... `Settings-->Sharing-->Remote Desktop`
Nicholas Redi avatar
br flag
I just realized that disabling the Keyring password feature (i.e. set a blank psw) I am able to automatically login into my Ubuntu operating system and make the remote connection works (even with the trick to immediately lock the screen enabled after the boot). I really don't like much this but it seems to be the only solution without involving a lot of plumbing. I vote up your answer for now, but please let me know if something more comfortable can be reached!
Nicholas Redi avatar
br flag
" You need to enable gnome remote desktop first ... Settings-->Sharing-->Remote Desktop " --> @Raffa It's not a matter of this ! Gnome Remote Desktop was already enabled, the problems was the Keyring password feature enabled by default in Ubuntu 22.
Raffa avatar
jp flag
@NicholasRedi Setting a blank password in keying will disable encryption required for remote desktop clients that don't support it like Windows remote desktop app ... This was also a problem with previous Ubuntu [Vino server](https://askubuntu.com/a/1326144/968501) ... However back then `gsettings set org.gnome.Vino require-encryption false` was the way to disable it ... Now it's a pity there is no separate clean way to disable encryption for the new VNC server other than disabling encryption for all passwords in the keying.
Nicholas Redi avatar
br flag
Got it, thanks... I am going to keep the keyring psw blank foe now...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.