11

I set up a automated kickstart-installation for a "digital-signage-client" based on Fedora 30 (soon 32), now I want to add the enabling of the "Gnome Screen Sharing" to the installation to be able to get an actual visual feedback what is on the screen right now. I got this to work via the settings in the GUI (Settings - Sharing - Screen Sharing) and I'm also able to set the "subsettings" via gesettings, e.g.

gsettings set org.gnome.desktop.remote-desktop.vnc view-only false
gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password'

But I wasn't able to find the setting to enable the "Screen Sharing" itself. When I enable it via the GUI, I can see via systemctl status:

systemctl status | grep gnome-remote | grep -v grep
           │   │ ├─gnome-remote-desktop.service
           │   │ │ └─5572 /usr/libexec/gnome-remote-desktop-daemon

I tried to start this service and also the "daemon" directly with systemctl start, but it only results in Failed to start gnome-remote-desktop-daemon.service: Unit gnome-remote-desktop-daemon.service not found.

There are two quite similar questions, but the seem outdated, because I don't have a schema "org.gnome.Vino":

So: How can I enable Gnome Screen Sharing via Commandline?

Addition:

I’ve invested a lot of time to get this to work and could solve all but one problem. I now know, that I have to start the service as User, so my whole procedure is:

# Configuration
gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password'
gsettings set org.gnome.desktop.remote-desktop.vnc view-only false
gsettings set org.gnome.settings-daemon.plugins.sharing.service:/org/gnome/settings-daemon/plugins/sharing/gnome-remote-desktop/ enabled-connections "['$( grep UUID /etc/sysconfig/network-scripts/ifcfg-enp1s0 | cut -d= -f2)']"

# Start the Remote-Desktop-Service
systemctl start --user gnome-remote-desktop

I set it to “password” to not have someone to click on “accept”, “view-only” to “false” to be able to control it and set the UUID of my network-interface. Afterwards I can start the service correctly configured.

So the last missing step is, that I’m not able to set the password via the commandline. I tried it like for vino and also with secret-tool, but it doesn’t work

gsettings set org.gnome.Vino vnc-password $(echo -n "myPassword"|base64)
secret-tool store --label='Label' {attribute} {value}

The problem with secret-tool is maybe, that the original entry in the Gnome keyring doesn't has a "attribute" and a "value", but those are mandatory for secret tool, so I can't reproduce the entry 1:1.

So: Has someone an idea, how I can set the password for gnome-screen-sharing correctly via cli?

2 Answers 2

7

So I did it after poking at it for a couple of hours.

Your instructions are correct. However, GNOME won't allow a VNC connection if your screen is locked. So, using loginctl list-sessions you can list your sessions. Find the graphical one (should have an identifier seat0 or similar) and unlock it with loginctl unlock-session X where X comes from the ID column of list-sessions. To verify, you can loginctl show-session X and you should have LockedHint=no. Once that's done, try logging in via VNC. For me, it worked immediately.

To recap, here's all the steps:

gsettings set org.gnome.desktop.remote-desktop.vnc auth-method 'password'
gsettings set org.gnome.desktop.remote-desktop.vnc view-only false
echo -n 'password' | secret-tool store --label="GNOME Remote Desktop VNC password" "xdg:schema" "org.gnome.RemoteDesktop.VncPassword"
systemctl --user start gnome-remote-desktop.service
loginctl unlock-session $(loginctl --no-legend --value list-sessions | awk '/seat/ { print $1}')

Didn't need to allow the network interface or anything else

3
  • 1
    Worked for me, though I did have an extra issue where the secret-tool command was hanging. I believe it was popping up a dialog to unlock the gnome keyring on the desktop side. I found that killing all and then unlocking with echo -n "password" | /usr/bin/gnome-keyring-daemon --unlock before running secret-tool solved this issue. Nov 7, 2021 at 18:42
  • Also, if that doesn't work the changing the arguments to be gnome-keyring-daemon --daemonize --login seems more reliable. (from unix.stackexchange.com/a/602935/89887) Nov 11, 2021 at 5:30
  • Are the instances here where echo -n "password" is used, that "password" should be your account password? Mar 7, 2022 at 16:59
1

I've cleaned up and forked a script this works on ubuntu 22.04 with wayland disabled.

https://gist.github.com/Pieter81/78a3a087f142d712951f8352bb9ab2ba

You must log in to answer this question.

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