Hello, 
I'm attempting to automate the process to build images for use on other 
machines.

first enable gsettings
gsettings set org.gnome.desktop.remote-desktop.rdp enable true
gsettings set org.gnome.desktop.remote-desktop.rdp screen-share-mode 
mirror-primary
gsettings set org.gnome.desktop.remote-desktop.rdp view-only false

then create a Default_keyring.keyring
create_default_keyring() {
    # Define the path for the keyring
    local keyring_path="$HOME/.local/share/keyrings/Default_keyring.keyring"

    # Create the directory if it doesn't exist
    mkdir -p "$HOME/.local/share/keyrings/"

    # Write the content to the keyring file
    cat <<EOL > "$keyring_path"
[keyring]
display-name=Default keyring
ctime=1723570530
mtime=0
lock-on-idle=false
lock-after=false

[1]
item-type=0
display-name=GNOME Remote Desktop RDP credentials
secret={'username': <''>, 'password': <''>}
mtime=1723570630
ctime=1723570530

[1:attribute0]
name=xdg:schema
type=string
value=org.gnome.RemoteDesktop.RdpCredentials
EOL

    # Set the permissions to rw------- (600)
    chmod 600 "$keyring_path"

    echo "Default_keyring.keyring has been created at $keyring_path with 
permissions 600"
}

then create the other default file

create_default_link() {
    # Define the path for the default file
    local default_path="$HOME/.local/share/keyrings/default"

    # Create the directory if it doesn't exist
    mkdir -p "$HOME/.local/share/keyrings/"

    # Write the content to the default file
    echo "Default_keyring" > "$default_path"

    # Set the permissions to rw-rw-r-- (664)
    chmod 664 "$default_path"

    echo "Default file has been created at $default_path with permissions 664"
}


But I still must open the GUI > settings > system > remote desktop, do nothing, 
and close it. Then the machine will accept RDP with the username password set 
above.


I can also use grdctl and toggle the password, but still must open the
GUI menu once.

# Function to clear and set RDP credentials
set_rdp_credentials() {
    local username="$1"
    local password="$2"

    # Logging utility
    log() {
        echo "$1"
    }

    # Clear existing RDP credentials
    log "Clearing existing RDP credentials..."
    grdctl rdp clear-credentials
    log "RDP credentials cleared."

    # Set new RDP credentials
    log "Setting new RDP credentials for user '$username'..."
    grdctl rdp set-credentials "$username" "$password"
    log "RDP credentials set for user '$username'."
}

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to gnome-remote-desktop in Ubuntu.
https://bugs.launchpad.net/bugs/2064647

Title:
  Documentation for how to enable gnome-remote-desktop on a completly
  headless system

Status in gnome-remote-desktop package in Ubuntu:
  Triaged

Bug description:
  Asked to create a new bug from
  https://bugs.launchpad.net/ubuntu/+source/gnome-remote-
  desktop/+bug/2063333

  I am on a completely headless system starting from a minimal ubuntu-server 
24.04 installation.
  I have installed the desktop using apt install ubuntu-desktop

  I want to use the new gnome-remote-desktop so that I can create a
  developer machine in a VM environment that can be accessed through a
  thin client as an example using Microsoft RDP

  I suspect there is some missing documentation.

  Starting the service using systemctl start gnome-remote-
  desktop.service

  results in:

  journalctl -xeu gnome-remote-desktop.service
  Apr 30 10:16:39 localhost systemd[1]: Starting gnome-remote-desktop.service - 
GNOME Remote Desktop...
  ░░ Subject: A start job for unit gnome-remote-desktop.service has begun 
execution
  ░░ Defined-By: systemd
  ░░ Support: http://www.ubuntu.com/support
  ░░
  ░░ A start job for unit gnome-remote-desktop.service has begun execution.
  ░░
  ░░ The job identifier is 2929.
  Apr 30 10:16:39 localhost (p-daemon)[1613]: gnome-remote-desktop.service: 
Failed to determine user credentials: No such process
  Apr 30 10:16:39 localhost systemd[1]: gnome-remote-desktop.service: Main 
process exited, code=exited, status=217/USER
  ░░ Subject: Unit process exited
  ░░ Defined-By: systemd
  ░░ Support: http://www.ubuntu.com/support
  ░░
  ░░ An ExecStart= process belonging to unit gnome-remote-desktop.service has 
exited.
  ░░
  ░░ The process' exit code is 'exited' and its exit status is 217.

  Running sudo systemd-sysusers does create some new users, restarting the 
remote desktop now gives:
  May 02 14:27:47 localhost gnome-remote-de[36906]: Init TPM credentials failed 
because No TPM device found, using GKeyFile as fallback
  May 02 14:27:47 localhost gnome-remote-de[36906]: Init file credentials 
failed: Error creating directory /var/lib/gnome-remote-desktop: Permission 
denied
  May 02 14:27:47 localhost gnome-remote-desktop-daemon[36906]: **
  May 02 14:27:47 localhost gnome-remote-desktop-daemon[36906]: 
ERROR:../src/grd-settings.c:345:grd_settings_constructed: assertion failed: 
(priv->credentials)
  May 02 14:27:47 localhost gnome-remote-desktop-daemon[36906]: Bail out! 
ERROR:../src/grd-settings.c:345:grd_settings_constructed: assertion failed: 
(priv->credentials)
  May 02 14:27:47 localhost systemd[1]: gnome-remote-desktop.service: Main 
process exited, code=dumped, status=6/ABRT

  As a headless system I can not use any UI controls so I suspect there
  is some command / config that needs to to be set before launching rdp

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-remote-desktop/+bug/2064647/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to