3

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

2
  • 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? Commented Mar 11, 2023 at 5:19
  • 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. Commented Mar 12, 2023 at 6:25

1 Answer 1

2

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'
7
  • 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 :( Commented Jan 2, 2023 at 10:43
  • 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... Commented Jan 2, 2023 at 10:47
  • @NicholasRedi You need to enable gnome remote desktop first ... Settings-->Sharing-->Remote Desktop
    – Raffa
    Commented Jan 2, 2023 at 13:41
  • 1
    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! Commented Jan 2, 2023 at 13:44
  • " 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. Commented Jan 2, 2023 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .