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

  • 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? – Terrible Tadpole Mar 11 '23 at 05: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. – Nicholas Redi Mar 12 '23 at 06:25

1 Answers1

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'
Raffa
  • 32,237
  • 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 Jan 02 '23 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... – Nicholas Redi Jan 02 '23 at 10:47
  • @NicholasRedi You need to enable gnome remote desktop first ... Settings-->Sharing-->Remote Desktop – Raffa Jan 02 '23 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! – Nicholas Redi Jan 02 '23 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. – Nicholas Redi Jan 02 '23 at 13:49
  • @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 ... 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. – Raffa Jan 02 '23 at 15:10
  • Got it, thanks... I am going to keep the keyring psw blank foe now... – Nicholas Redi Jan 03 '23 at 16:08