From 9811ce6e3d1722aed6156c8e64368f11894ed869 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Wed, 4 Mar 2026 16:25:39 -0800 Subject: [PATCH] fix: wait for Xvfb before starting x11vnc in Docker entrypoint (#4975) Co-authored-by: Claude Opus 4.6 --- entrypoint-skyvern.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/entrypoint-skyvern.sh b/entrypoint-skyvern.sh index cf5076876..b04d0e5bd 100755 --- a/entrypoint-skyvern.sh +++ b/entrypoint-skyvern.sh @@ -57,6 +57,17 @@ xvfb=$! DISPLAY=:99 xterm 2>/dev/null & +# Wait for Xvfb to be ready before starting x11vnc +for i in $(seq 1 10); do + xdpyinfo -display :99 >/dev/null 2>&1 && break + echo "Waiting for Xvfb to start (attempt $i/10)..." + sleep 1 +done +if ! xdpyinfo -display :99 >/dev/null 2>&1; then + echo "ERROR: Xvfb failed to start on display :99 after 10 attempts" + exit 1 +fi + echo "Starting x11vnc on display :99..." # VNC runs without a password (-nopw) because port 5900 is not exposed outside # the container. Browser streaming reaches users via websockify on port 6080.