Hello,
I need some help understanding why my setup, which worked up until several months back, has stopped working. I suspect it stopped working when I moved from Silverblue to Kinoite, but I cannot say that for certain.
My setup is intended to allow me to use VS Code (running via a Flatpak) to remotely connect into a toolbox via SSH (using the Remote Development extension), and debug a UI application. As I said, this all worked until recently, but now VS Code fails to start debugging the application.
My ~/.ssh/config enables X11 forwarding and specifies that the toolbox should use a wrapper script for xauth:
Host *-toolbox
# Connecting to the toolbox name will redirect to "localhost". Each toolbox should define an appropriate port.
HostName localhost
# Save some CPU cycles by skipping compression.
Compression no
ForwardX11 true
ForwardX11Trusted true
XAuthLocation /home/me/repository/bootstrap/scripts/xauth-wrapper.sh
Host project-toolbox
Port 2200
And xauth-wrapper.sh looks like this:
#!/bin/bash
LOG_FILE="/home/me/tmp/xauth-wrapper-debug.log"
log() {
echo "$(date): $@" >> "$LOG_FILE"
}
# The path to xauth on the host.
XAUTH_PATH="/usr/sbin/xauth"
log "caller: '$(whoami)'"
log "PID: '$$'"
log "args: '$*'"
log "FLATPAK_ID: '$FLATPAK_ID'"
log "XAUTHORITY: '$XAUTHORITY'"
log "XAUTH_PATH: '$XAUTH_PATH'"
log "DISPLAY: '$DISPLAY'"
log "PATH: '$PATH'"
if [ -n "$FLATPAK_ID" ]; then
log "Running inside a Flatpak, so starting xauth via flatpak-spawn --host"
flatpak-spawn --host "$XAUTH_PATH" "$@" 2>&1 | tee -a "$LOG_FILE"
SPAWN_EXIT_CODE=${PIPESTATUS[0]}
log "flatpak-spawn exit code: $SPAWN_EXIT_CODE"
exit $SPAWN_EXIT_CODE
else
log "Running directly"
"$XAUTH_PATH" "$@" 2>&1 | tee -a "$LOG_FILE"
DIRECT_EXIT_CODE=${PIPESTATUS[0]}
log "direct run exit code: $DIRECT_EXIT_CODE"
exit $DIRECT_EXIT_CODE
fi
The /etc/ssh/sshd_config in the toolbox contains:
Port 2200
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
# Vital for scp support, which VS Code uses to copy binaries into the SSH host when doing remote development.
Subsystem sftp /usr/libexec/openssh/sftp-server
If I ssh project-toolbox and echo $DISPLAY, it shows localhost:10.0 as you’d expect, and the log looks like this:
Wed Feb 11 06:22:30 PM AEST 2026: caller: 'me'
Wed Feb 11 06:22:30 PM AEST 2026: PID: '229185'
Wed Feb 11 06:22:30 PM AEST 2026: args: 'list :0'
Wed Feb 11 06:22:30 PM AEST 2026: FLATPAK_ID: ''
Wed Feb 11 06:22:30 PM AEST 2026: XAUTHORITY: '/run/user/1000/xauth_kLHLbQ'
Wed Feb 11 06:22:30 PM AEST 2026: XAUTH_PATH: '/usr/sbin/xauth'
Wed Feb 11 06:22:30 PM AEST 2026: DISPLAY: ':0'
Wed Feb 11 06:22:30 PM AEST 2026: PATH: '/home/me/.local/bin:/home/me/.local/bin:/home/me/.local/bin:/home/me/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin'
Wed Feb 11 06:22:30 PM AEST 2026: Running directly
box/unix:0 MIT-MAGIC-COOKIE-1 c2dc47929a694e891bab3efa399187a1
#ffff##:0 MIT-MAGIC-COOKIE-1 c2dc47929a694e891bab3efa399187a1
Wed Feb 11 06:22:30 PM AEST 2026: direct run exit code: 0
I can’t explain why DISPLAY is :0 rather than localhost:10.0, but it clearly works. I can run an X11 application like xeyes or xclock from that session and it shows just fine.
But if I connect to the same toolbox via SSH in VS Code, it does manage to connect and allow full editing of the project, and it does allow me to build the application, but if I attempt to run or debug the application, I see this error in the console:
(app203187): Gtk-WARNING **: 18:12:18.013: cannot open display:
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Linux.
And in this case the log displays:
Wed Feb 11 05:00:20 PM AEST 2026: caller: 'me'
Wed Feb 11 05:00:20 PM AEST 2026: PID: '2295'
Wed Feb 11 05:00:20 PM AEST 2026: args: 'list 1'
Wed Feb 11 05:00:20 PM AEST 2026: FLATPAK_ID: 'com.visualstudio.code'
Wed Feb 11 05:00:20 PM AEST 2026: XAUTHORITY: '/run/user/1000/xauth_kLHLbQ'
Wed Feb 11 05:00:20 PM AEST 2026: XAUTH_PATH: '/usr/sbin/xauth'
Wed Feb 11 05:00:20 PM AEST 2026: DISPLAY: '1'
Wed Feb 11 05:00:21 PM AEST 2026: PATH: '/app/bin:/app/bin:/app/bin:/usr/bin:/home/me/.var/app/com.visualstudio.code/data/node_modules/bin'
Wed Feb 11 05:00:21 PM AEST 2026: Running inside a Flatpak, so starting xauth via flatpak-spawn --host
/usr/sbin/xauth: (argv):1: bad display name "1" in "list" command
Wed Feb 11 05:00:21 PM AEST 2026: flatpak-spawn exit code: 1
As you can see, DISPLAY is set to 1, which is not a valid value (:1 would be valid). I cannot figure out where it’s coming from. I’ve tried explicitly setting the DISPLAY environment variable in the Flatpak settings for VS Code, but it doesn’t seem to come through.
Does anyone have any suggestions as to what might be going on or how to diagnose this?