Files
docker-xserver-novnc/scripts/server.sh
T
jensandClaude Sonnet 5 089872fd28 Switch to ich777/novnc-baseimage and fix stale X lock on restart
jayfield/novnc-baseimage no longer resolves, so point at the public
ich777/novnc-baseimage instead. That image lays out TurboVNC, websockify,
and noVNC via standard package paths rather than /opt/TurboVNC and
/tmp/websockify /tmp/noVNC, so server.sh is updated to match.

Also remove any stale .X99-lock/.X11-unix socket before starting Xvnc,
since /tmp survives docker stop/start and previously left Xvnc unable to
rebind the display on restart. Signal exit-code math in signals.sh now
uses bash arithmetic instead of bc, which isn't present in the new base
image.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZjg4yXCYacriPz3euenQF
2026-07-27 23:07:00 +02:00

18 lines
711 B
Bash
Executable File

#!/usr/bin/env bash
set -x
RFB_PORT=59${DISPLAY_NUM}
NOVNC_PORT=80${DISPLAY_NUM}
echo Display at ${DISPLAY} with ${SCREEN_W}x${SCREEN_H}x24
# Xvnc doesn't get a chance to clean these up when the container is killed/stopped,
# and /tmp persists across `docker restart`, so a stale lock blocks the next start.
rm -f /tmp/.X${DISPLAY_NUM}-lock /tmp/.X11-unix/X${DISPLAY_NUM}
Xvnc ${DISPLAY} -geometry ${SCREEN_W}x${SCREEN_H} -depth 24 +xinerama -securitytypes none >/var/log/xvfb.log &
fluxbox &
websockify -D --web=/usr/share/novnc/ --cert=/tmp/novnc.pem --key=/tmp/novnc.key ${NOVNC_PORT} localhost:${RFB_PORT}
socat TCP-LISTEN:60${DISPLAY_NUM},fork,bind=0.0.0.0 UNIX-CONNECT:/tmp/.X11-unix/X${DISPLAY_NUM}