Category: Ubuntu 25.10

  • Ubuntu 25.10 Remote Desktop Auto-Setup

    Warning: Potentially Unsecure Scripts Below

    Following up on a previous post trying to get the x11-less Ubuntu 25.10 set up with GUI management it looks like it’s possible to get Remote Desktop working. (Spice, unfortunately, has not been updated much in a long time and the install command seems to not work.)

    This doesn’t work fully yet, still running into keychain issues, but it’s close. On Reddit, user LarkinZero has a script that resets the password on boot. (Below.) Now, this is a keychain change which doesn’t unlock on boot. Trying another script from jdonohoo on GitHub almost works but still getting an error, auto-login on or off.

    With both scripts there are potential security issues such as having a password in plaintext and auto keyring unlocking (besides it still not working fully.) Will keep following up on this.

    Now I will say, this does seem to unlock via just a couple CLI commands so this might be good enough. Will revisit soon.

    Remote Credentials Update.

    #!/bin/bash
    
    SCHEMA="org.gnome.RemoteDesktop.RdpCredentials"
    LABEL="GNOME Remote Desktop RDP credentials"
    USERNAME="abc"
    PASSWORD="123456"
    EXPECTED_VALUE="{'username': <'$USERNAME'>, 'password': <'$PASSWORD'>}"
    
    echo "Step 1: Clearing old credentials..."
    secret-tool clear xdg:schema "$SCHEMA"
    
    echo "Step 2: Storing new credentials..."
    echo -n "$EXPECTED_VALUE" | secret-tool store --label="$LABEL" xdg:schema "$SCHEMA"
    
    echo "Step 3: Verifying stored credentials..."
    RESULT=$(secret-tool lookup xdg:schema "$SCHEMA")
    
    if [ "$RESULT" == "$EXPECTED_VALUE" ]; then
        echo "Success: Stored credentials match the expected value."
        exit 0
    else
        echo "Error: Stored credentials do not match the expected value."
        exit 1
    fi

    Keyring unlock script.

    ```
    sudo apt-get install -y gnome-keyring libsecret-tools dbus-x11 vim
    ```
    
    1. Place your unlock script here:
    ```
    vim ~/.config/unlock-keyring.sh
    ```
    ```
    #!/bin/bash
    
    export DISPLAY=:0
    export XDG_RUNTIME_DIR=/run/user/$(id -u)
    
    password=$(<"$HOME/.keyring_pass")
    /usr/bin/gnome-keyring-daemon --unlock <<< "$password"
    ```
    
    ```
    chmod +x ~/.config/unlock-keyring.sh
    ```
    2. Create keyring password file
    ```
    vim ~/.keyring_pass
    ```
    ```
    chmod 600 ~/.keyring_pass
    ```
    
    3. Create the systemd unit:
    
    ```
    vim ~/.config/systemd/user/unlock-keyring.service
    ```
    
    ```
    [Unit]
    Description=Unlock GNOME Keyring
    After=graphical-session.target
    
    [Service]
    Type=oneshot
    ExecStart=%h/.config/unlock-keyring.sh
    RemainAfterExit=true
    Environment=DISPLAY=:0
    Environment=XDG_RUNTIME_DIR=/run/user/%U
    
    [Install]
    WantedBy=default.target
    ```
    
    4. Enable the service:
    ```
    systemctl --user daemon-reload
    systemctl --user enable unlock-keyring.service
    ```
    5. Ditch login keyring to make new one on next boot
    ```
    rm ~/.local/share/keyrings/login.keyring
    ```
    Set login passphrase to same as default / what you have in ~/.keyring_pass
    
    Optional test:
    
    ```
    systemctl --user start unlock-keyring.service
    ```

    Ubuntu 25.10