Public bug reported:

ProblemType: Bug                                                                
                                                                                
        
Package: gnome-remote-desktop 46.3-0ubuntu1.2                                   
                                                                                
        
                                                                                
                                                                                
        
1) Release:                                                                     
                                                                                
        
Ubuntu 24.04.4 LTS (Noble Numbat)                                               
                                                                                
        
                                                                                
                                                                                
      
2) Package version:                          
gnome-remote-desktop 46.3-0ubuntu1.2 (from noble-updates/main)

3) What you expected to happen:
RDP connections to port 3389 should complete the two-daemon handover: the 
system daemon accepts the connection, GDM presents a login screen via the 
greeter's handover
daemon, and after authentication the connection is handed over to the user 
session's handover daemon, which serves the desktop. This is the architecture 
introduced in
the LP:#2072130 backport.

4) What happened instead:
RDP connections fail with ERRINFO_CB_CONNECTION_CANCELLED after a 30-second 
timeout. The handover daemon (gnome-remote-desktop-daemon --handover) never 
starts in either
  GDM greeter sessions or GDM-created user sessions. The system daemon's 
Handovers ObjectManager is always empty. Stale GDM greeter sessions accumulate 
(one per failed
connection attempt).

Root cause — two packaging issues:

1. Missing autostart entries. The package installs 
org.gnome.RemoteDesktop.Handover.desktop to /usr/share/applications/ but does 
not place it in any autostart
directory. The handover daemon is never launched by gnome-session in GDM 
greeter sessions or GDM-created user sessions. The upstream data/meson.build 
generates this
file as an autostart entry, but the Ubuntu package does not install it to 
/etc/xdg/autostart/ or /usr/share/gdm/greeter/autostart/.
2. X-GNOME-HiddenUnderSystemd=true incorrectly hides the entry. Even if the 
.desktop file were placed in an autostart directory, this flag causes 
gnome-session to hide
it in GDM-created RDP user sessions. GDM-created user sessions run 
gnome-session-binary --session=ubuntu (without --systemd-service), but 
gnome-session still detects
the shared systemd user manager's [email protected] and treats the 
session as systemd-managed. The handover daemon's autostart entry is hidden and 
never
launched.

2. The systemd unit (gnome-remote-desktop-handover.service, 
WantedBy=gnome-session.target) cannot compensate because the systemd user 
manager is shared across all
sessions for a uid — gnome-session.target is already reached before the RDP 
session is created, so the WantedBy dependency does not re-trigger.

The handover flow requires two autostart activations:

1. GDM greeter session — the handover daemon must start to pick up the initial 
RDP connection and display the login screen. Requires an entry in
/usr/share/gdm/greeter/autostart/.
2. GDM-created user session (after authentication) — the handover daemon must 
start to pick up the redirected connection and serve the desktop. Requires an 
entry in
/etc/xdg/autostart/ without X-GNOME-HiddenUnderSystemd=true.

Workaround:

Create two autostart files without the X-GNOME-HiddenUnderSystemd flag,
and disable the systemd unit:

# GDM greeter sessions
sudo tee 
/usr/share/gdm/greeter/autostart/org.gnome.RemoteDesktop.Handover.desktop << 
'EOF'
[Desktop Entry]
Type=Application
Name=GNOME Remote Desktop Handover Daemon
Exec=/usr/libexec/gnome-remote-desktop-daemon --handover
Terminal=false
NoDisplay=true
X-GNOME-AutoRestart=true
EOF

# User sessions (after RDP authentication)
sudo tee /etc/xdg/autostart/org.gnome.RemoteDesktop.Handover.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=GNOME Remote Desktop Handover Daemon
Exec=/usr/libexec/gnome-remote-desktop-daemon --handover
Terminal=false
NoDisplay=true
X-GNOME-AutoRestart=true
EOF

# Disable the systemd unit (autostart handles activation)
systemctl --user disable gnome-remote-desktop-handover.service

# Remove system-wide systemd enable if present
sudo rm -f 
/etc/systemd/user/gnome-session.target.wants/gnome-remote-desktop-handover.service

A reboot is required after applying the workaround.

Additional observations during debugging:

- The system daemon (running as uid 993) shows g_atomic_ref_count_dec: 
assertion 'old_value > 0' failed after sending server redirections, and 
intermittently segfaults
(use-after-free in the handover cleanup path). Crash files exist at 
/var/crash/_usr_libexec_gnome-remote-desktop-daemon.993.crash.
- The handover daemon also segfaults when the systemd unit and gnome-session 
autostart both try to manage it simultaneously (the systemd unit sends SIGTERM 
while the
daemon is mid-handover). Crash file: 
/var/crash/_usr_libexec_gnome-remote-desktop-daemon.1000.crash.
- The handover daemon's RequestHandover call to the Dispatcher is one-shot with 
no retry mechanism — it only retries when the system daemon's D-Bus name 
vanishes and
reappears. This makes per-connection autostart activation (not long-running 
residence) the correct design.

Fragile reconnection behavior:

Even with the workaround applied, disconnect-and-reconnect is fragile. The 
first connection from a clean state works reliably — GDM greeter handover picks 
up the
connection, user authenticates, gnome-session in the new user session 
autostarts the handover daemon, and the desktop is served. However, when the 
user disconnects and
immediately reconnects, the second connection fails with a 30-second handover 
timeout. The old user session's handover daemon is still running (or recently 
exited), and
  no fresh handover daemon is activated for the new connection attempt. The 
system daemon's g_atomic_ref_count_dec assertion also fires during 
reconnection, suggesting a
  use-after-free in the connection teardown/setup path. A full GDM session 
cleanup (terminating the stale greeter and user sessions) is required before 
reconnecting.

** Affects: gnome-remote-desktop (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2154408

Title:
  RDP handover daemon never starts — missing autostart entries and
  X-GNOME-HiddenUnderSystemd blocks activation

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to