Skip to content

Instantly share code, notes, and snippets.

@vinitkumar
Created September 18, 2026 07:27
Show Gist options
  • Select an option

  • Save vinitkumar/0bd5d2f4c2746437a9943a284fa4c0f3 to your computer and use it in GitHub Desktop.

Select an option

Save vinitkumar/0bd5d2f4c2746437a9943a284fa4c0f3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Collect Remote Cast screen-share diagnostics from a Linux desktop.
#
# Run as the logged-in desktop user (NOT root, NOT via sudo):
# bash diag-remote-cast.sh
# Sends everything to remote-cast-diag-<host>-<time>.txt in the current
# directory. Attach that file to the ticket.
set +e
AGENT=/opt/tux-agent/libexec/remote-agent
OUT="remote-cast-diag-$(hostname)-$(date +%Y%m%d-%H%M%S).txt"
section() { printf '\n===== %s =====\n' "$1"; }
run() { printf '$ %s\n' "$*"; "$@" 2>&1; printf '[exit=%s]\n' "$?"; }
{
if [ "$(id -u)" = "0" ]; then
echo "WARNING: running as root. Re-run as the logged-in desktop user; the probe needs that user's session."
fi
section "1. Desktop"
run grep -E '^(NAME|VERSION_ID|VERSION)=' /etc/os-release
echo "USER=$(id -un) UID=$(id -u)"
echo "XDG_SESSION_TYPE=${XDG_SESSION_TYPE:-} XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP:-}"
echo "WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-} DISPLAY=${DISPLAY:-}"
echo "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-} DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS:-}"
run loginctl list-sessions
for sid in $(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $1}'); do
run loginctl show-session "$sid" -p Id -p Name -p Type -p Class -p State -p Desktop
done
section "2. remote-agent capability probe"
if [ -x "$AGENT" ]; then
run "$AGENT" --version
run "$AGENT" capabilities --json --log-file ""
else
echo "MISSING: $AGENT"
run ls -la /opt/tux-agent/libexec
fi
section "3. Tools the probe shells out to"
run which gdbus pw-cli pactl
run pw-cli info 0
run pactl info
run gdbus introspect --session --dest org.freedesktop.portal.Desktop \
--object-path /org/freedesktop/portal/desktop
run gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.ListNames
section "4. Portal / PipeWire packages and user services"
if command -v dpkg >/dev/null; then
run sh -c "dpkg -l | grep -E 'xdg-desktop-portal|pipewire|wireplumber|libglib2.0-bin' | awk '{print \$2, \$3}'"
elif command -v rpm >/dev/null; then
run sh -c "rpm -qa | grep -E 'xdg-desktop-portal|pipewire|wireplumber|glib2'"
fi
run systemctl --user --no-pager status pipewire pipewire-pulse wireplumber xdg-desktop-portal \
xdg-desktop-portal-gnome xdg-desktop-portal-gtk xdg-desktop-portal-cosmic xdg-desktop-portal-kde
run ls -la /usr/share/xdg-desktop-portal/portals/
run cat /usr/share/xdg-desktop-portal/portals-conf 2>/dev/null
run sh -c "cat /usr/share/xdg-desktop-portal/*-portals.conf ~/.config/xdg-desktop-portal/*.conf 2>/dev/null"
section "5. tux-agent log (remote_cast lines, last 2h) — may prompt for sudo"
run sudo -n journalctl -u tux-agent --since "2 hours ago" --no-pager -o cat \
| grep -E 'remote_cast|capabilit' || echo "(sudo unavailable or no lines)"
section "6. Last remote-agent session log"
last="$(ls -t ~/.local/share/tux-agent/remote-agent*.log /var/log/tux-agent/remote-agent*.log 2>/dev/null | head -1)"
if [ -n "$last" ]; then
echo "file: $last"
run tail -n 200 "$last"
else
echo "(no remote-agent session log found)"
fi
} > "$OUT" 2>&1
echo "Diagnostics written to: $OUT"
echo "Attach this file. It contains no credentials."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment