feat: add Xvfb + RustDesk scripts for VPS GUI fix (#6)\n\n- scripts/vps/start-rustdesk-xvfb.sh: Xvfb + xcompmgr + RustDesk launcher\n- scripts/host/manual-start-rustdesk.sh: manual run script for VPS\n\nWorkaround for RustDesk v1.4.6 SIGSEGV on dummy/Xvfb display\nwhen opening GUI (Flutter requires GL/GLES compositor).\n\nCloses #6 (partial)

This commit is contained in:
Orchestrator
2026-05-16 00:46:53 +01:00
parent 43e7b30f41
commit 038b9791c5
2 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
#!/bin/bash
# RustDesk Client Launcher for VPS (Manual Run)
# Run this script when you want to connect to host from VPS
# 1. Ensure no conflicting X servers
pkill -f Xvfb
pkill -f Xorg
# 2. Start Xvfb on :0
rm -f /tmp/.X11-unix/X0 /tmp/.X0-lock 2>/dev/null
/usr/bin/Xvfb :0 -screen 0 1920x1080x24 +extension GLX +extension RANDR +extension RENDER -ac &
echo "Xvfb started on :0"
sleep 2
# 3. Configure RustDesk
cat > ~/.config/rustdesk/RustDesk2.toml <<'EOF'
rendezvous_server = 'localhost:21116'
custom-rendezvous-server = 'localhost:21116'
key = 'JDSXd9sxN6Y7mIzu3krSpPTTc4yjChfqpzgIH5fl9Iw='
nat_type = 1
serial = 0
unlock_pin = ''
[options]
local-ip-addr = '2.59.219.61'
EOF
# 4. Start RustDesk client
export DISPLAY=:0
export XAUTHORITY=/root/.Xauthority
export LIBVA_DRIVER_NAME=none
export VDPAU_DRIVER=none
# Add xauth for display :0
xauth -f "$XAUTHORITY" add :0 . $(mcookie) 2>/dev/null || true
echo "Starting RustDesk..."
nohup /usr/share/rustdesk/rustdesk &
echo "RustDesk started. Check ID: DISPLAY=:0 /usr/share/rustdesk/rustdesk --get-id"
sleep 2
echo "Current ID:"
DISPLAY=:0 /usr/share/rustdesk/rustdesk --get-id

View File

@@ -0,0 +1,56 @@
#!/bin/bash
# RustDesk VPS - запуск с Xvfb + xcompmgr для корректного GUI рендеринга
export DISPLAY=:0
export XAUTHORITY=/root/.Xauthority
export LIBGL_ALWAYS_SOFTWARE=1
export LIBVA_DRIVER_NAME=none
export VDPAU_DRIVER=none
# 1. Очищаем старые сессии
pkill -f Xvfb
pkill -f rustdesk
sleep 1
rm -f /tmp/.X11-unix/X0 /tmp/.X0-lock 2>/dev/null
# 2. Запускаем Xvfb с COMPOSITE extension
echo "Starting Xvfb..."
/usr/bin/Xvfb :0 -screen 0 1920x1080x24 +extension GLX +extension RANDR +extension RENDER +extension COMPOSITE -ac &
echo "Xvfb PID: $!"
sleep 2
# 3. Проверяем запуск Xvfb
if ! pgrep -f "Xvfb :0" >/dev/null; then
echo "ERROR: Xvfb failed to start"
exit 1
fi
echo "Xvfb OK"
# 4. Запускаем композитор
echo "Starting xcompmgr..."
if command -v xcompmgr >/dev/null 2>&1; then
/usr/bin/xcompmgr -d :0 &
else
echo "WARNING: xcompmgr not found. Install with: apt-get install -y xcompmgr"
fi
# 5. Настраиваем xauth
xauth -f "$XAUTHORITY" add :0 . $(mcookie) 2>/dev/null || true
chmod 600 "$XAUTHORITY"
# 6. Пишем конфиг
/root/write-rustdesk-config.sh
# 7. Запускаем RustDesk
echo "Starting RustDesk..."
nohup /usr/share/rustdesk/rustdesk &
sleep 5
echo "=== Status ==="
echo "Xvfb: $(pgrep -a Xvfb | grep :0 || echo 'NOT RUNNING')"
echo "RustDesk:"
pgrep -a rustdesk || echo 'NOT RUNNING'
echo ""
echo "RustDesk ID: $(/usr/share/rustdesk/rustdesk --get-id 2>/dev/null || echo 'N/A')"
echo ""
echo "To connect to host: rustdesk <host-id>"