Files
ultix/12-fix-rdp-bigres.sh
T
mrcharles 32dd4e64ea RDP black-screen root-caused: kwin_x11 compositing crash-loop; fixed (#611)
Server-side bisect (session rendered pure black, colors=1) pinned it to
plasma-kwin_x11.service timing out and crash-looping: software-GL
compositing init under xorgxrdp never completes at 5160x2160. Fix:
Compositing=false for the RDP accounts (X11-only key, Wayland console
unaffected) + 300s kwin unit start timeout. 12-fix-rdp-bigres.sh now
installs both parts. freerdp harness matrix green across all four flows.

Details: https://projects.knownelement.com/issues/611
2026-09-01 16:14:31 -05:00

74 lines
3.0 KiB
Bash
Executable File

#!/bin/bash
# 12-fix-rdp-bigres.sh — xrdp EGFX big-resolution fix (Redmine #611)
#
# Symptom: Jump Desktop from iPad -> big external monitor (5160x2160)
# showed color bars / cut sides. Root cause candidate: default EGFX
# compressed-frame budget truncates large frames at this width.
# freerdp UAT at 5160x2160 (all codecs + mid-session resize) is clean;
# this mitigation raises the budget for the Jump client path.
#
# Idempotent: run as root on ultix-streaming.
set -euo pipefail
DROPIN=/etc/systemd/system/xrdp.service.d/bigres.conf
mkdir -p "$(dirname "$DROPIN")"
cat > "$DROPIN" <<'EOF'
[Service]
Environment=XRDP_GFX_MAX_COMPRESSED_BYTES=33554432
Environment=XRDP_GFX_FRAMES_IN_FLIGHT=2
EOF
systemctl daemon-reload
# bounce only when nobody is connected: check for active RDP sessions first
ACTIVE=$(pgrep -c -f 'Xorg.*xrdp/xorg.conf' || true)
if [ "${ACTIVE:-0}" -gt 0 ]; then
echo "Active RDP X sessions: $ACTIVE — NOT restarting; apply at next bounce with:"
echo " systemctl restart xrdp-sesman xrdp"
else
systemctl restart xrdp-sesman xrdp
sleep 2
systemctl is-active xrdp xrdp-sesman
fi
grep -q XRDP_GFX_MAX_COMPRESSED_BYTES "$DROPIN" && echo "drop-in present: $DROPIN"
###############################################################################
# Part 2 — kwin_x11 black-screen fix (root-caused 2026-09-01, #611)
#
# Symptom: RDP login -> KDE spinner -> BLACK screen. Server-side bisect
# showed display :10 rendering pure black (colors=1): kwin_x11 was
# crash-looping (plasma-kwin_x11.service "start operation timed out",
# restart counter 12+). Cause: software-GL compositing init under
# xorgxrdp (no DRI) at 5160x2160 never finishes inside the unit's
# start timeout; systemd kills kwin -> no desktop. The "spinner" the
# user sees is KSplash firing on every kwin restart.
#
# Fix: disable X11 compositing for the RDP accounts (kwin runs
# uncomposited = instant, no GL) and give the kwin unit start-time
# headroom. Wayland console session unaffected (Compositing/Enabled is
# an X11-only key). Verified with the freerdp harness on rdptest:
# fresh 1408x945 / fresh 5160x2160 / resize up mid-session / resize
# down on reconnect — all render real desktops.
###############################################################################
for ACCOUNT in reachableceo reachableceo-offstage; do
runuser -u "$ACCOUNT" -- kwriteconfig6 --file kwinrc \
--group Compositing --key Enabled false
echo "kwinrc Compositing=false: $ACCOUNT"
done
mkdir -p /etc/systemd/user/plasma-kwin_x11.service.d
cat > /etc/systemd/user/plasma-kwin_x11.service.d/bigres-timeout.conf <<'EOF'
[Unit]
# big-res xorgxrdp sessions: software-GL init is slow; give kwin room
# instead of kill+crashloop (#611)
TimeoutStartSec=300
EOF
systemctl daemon-reload
echo "kwin unit override: /etc/systemd/user/plasma-kwin_x11.service.d/bigres-timeout.conf"
echo
echo "If a session is currently black: loginctl terminate-session <id> (or"
echo "loginctl terminate-user <user> for their RDP sessions) and reconnect."