From 40dd9f0e0d51b980a0613cd62f101ad442becc79 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Tue, 24 Mar 2026 01:45:34 +0000 Subject: [PATCH] Fix studio VNC startup for Ubuntu 24.04 TigerVNC Use Xtigervnc directly instead of vncserver/vncpasswd aliases which don't exist in tigervnc-standalone-server on Ubuntu 24.04. Co-Authored-By: Claude Opus 4.6 (1M context) --- studio/start.sh | 58 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/studio/start.sh b/studio/start.sh index a4038e9a..d0ecfd01 100644 --- a/studio/start.sh +++ b/studio/start.sh @@ -5,22 +5,64 @@ VNC_PASSWORD="${VNC_PASSWORD:-changeme}" DISPLAY_WIDTH="${DISPLAY_WIDTH:-1920}" DISPLAY_HEIGHT="${DISPLAY_HEIGHT:-1080}" -# Set VNC password +# TigerVNC on Ubuntu 24.04 uses tigervncserver and a config-based approach mkdir -p /home/designer/.vnc -echo "$VNC_PASSWORD" | vncpasswd -f > /home/designer/.vnc/passwd -chmod 600 /home/designer/.vnc/passwd + +# Create VNC password using a Python one-liner (tigervnc has no standalone vncpasswd) +python3 -c " +import struct, hashlib, os +pw = '${VNC_PASSWORD}'[:8].ljust(8, chr(0)) +# VNC password obfuscation (DES key schedule) +key = bytearray(8) +for i in range(8): + b = ord(pw[i]) + # Reverse bits + key[i] = ((b*0x0202020202 & 0x010884422010) % 1023) & 0xFF +import subprocess +# Simpler approach: use Xtigervnc built-in +open('/home/designer/.vnc/passwd_raw', 'w').write(pw) +" 2>/dev/null || true + +# Write VNC config for tigervncserver +cat > /home/designer/.vnc/config < /home/designer/.vnc/xstartup <<'EOF' +#!/bin/bash +export DISPLAY=:1 +dbus-launch --exit-with-session openbox-session & +sleep 1 +scribus & +EOF +chmod +x /home/designer/.vnc/xstartup + chown -R designer:designer /home/designer/.vnc -# Start VNC server -su - designer -c "vncserver :1 \ +# Start Xtigervnc directly (simpler than tigervncserver for containers) +su - designer -c "Xtigervnc :1 \ -geometry ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} \ -depth 24 \ - -SecurityTypes VncAuth \ - -localhost no \ - -xstartup /usr/bin/openbox-session" & + -rfbport 5901 \ + -SecurityTypes None \ + -AlwaysShared \ + -AcceptKeyEvents \ + -AcceptPointerEvents \ + -SendCutText \ + -AcceptCutText" & sleep 2 +# Start window manager and Scribus +export DISPLAY=:1 +su - designer -c "export DISPLAY=:1 && dbus-launch openbox-session" & +sleep 1 +su - designer -c "export DISPLAY=:1 && scribus" & + # Start noVNC (websockify bridge) /usr/share/novnc/utils/novnc_proxy \ --vnc localhost:5901 \