Skip to content

Instantly share code, notes, and snippets.

@pwright225
Forked from greyltc/launch-GRD.sh
Last active December 16, 2023 18:44
Show Gist options
  • Save pwright225/305835607c48e17a34f66b5a4e5bcb59 to your computer and use it in GitHub Desktop.
Save pwright225/305835607c48e17a34f66b5a4e5bcb59 to your computer and use it in GitHub Desktop.
configures then activates gnome-remote-desktop from the command line
#!/usr/bin/bash
#assuming you have already enabled autologin, ssh, and rdp from gnome settings gui; this allows you to reboot and get rdp to work again remotely from ssh.
TARGET_USER=REDACTED.your.user
RDP_USER="REDACTED.your.user"
RDP_PASS="REDACTED.your.password"
RDP_CREDS="{'username': <'${RDP_USER}'>, 'password': <'${RDP_PASS}'>}"
TLS_STORE=~/.local/share/gnome-remote-desktop
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"
systemctl restart --user gnome-remote-desktop
echo -n $RDP_PASS | /usr/bin/gnome-keyring-daemon --replace --unlock
# write RDP credentials to the keychain
echo -n ${RDP_CREDS} | secret-tool store --label "GRD RDP creds" xdg:schema org.gnome.RemoteDesktop.RdpCredentials
# allow RDP remote control
gsettings set org.gnome.desktop.remote-desktop.rdp view-only false
#allow virtual monitors to be created
gsettings set org.gnome.desktop.remote-desktop.rdp screen-share-mode extend
#one more keyring restart
echo -n $RDP_PASS | /usr/bin/gnome-keyring-daemon --replace --unlock
#one more RDP restart
systemctl restart --user gnome-remote-desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment