1

I want to build a script that will make the "screen sharing" through CLI (I have to do it on a lot of computers in the future and I want to add such script to another scripts that will configure the OS),

I currently know how to do it through the GUI: https://linuxhint.com/enable-screen-sharing-ubuntu/

How can I use CLI to make this configuration: using GUI

I don't find on the NET any bunch of instructions that can make it... the most close answer to my question i found is this: Enable remote VNC from the commandline? but it still not triggers the sharing at the GUI.

mkdahan
  • 31

1 Answers1

0

One step that is not often mentioned is that you need to enable auto login, you can do so by editing the following file:

sudo vi /etc/gdm3/custom.conf

And adding the following lines (or modifying existing vales):

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=myuser

Also sharing has to be enabled for specific network connection(s).

Find the current active "Network Manager" connection UUID via:

nmcli con

You can see the currently shared networks via:

dconf read /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections

If the UUID for the network connection to want to desktop share over is not there add it as follows:

dconf write /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections "['2bae8cfd-0d24-3e0d-ab84-4ae606e11df7']"

Set the password:

PASSWORD="passwordgoeshere"
dconf write /org/gnome/desktop/remote-access/vnc-password \"\'$(echo -n $PASSWORD | base64)\'\"

Set remaining sharing settings:

dconf write /org/gnome/desktop/remote-access/authentication-methods "['vnc']"
dconf write /org/gnome/desktop/remote-access/prompt-enabled false
watsonmw
  • 111
  • 2