# Start Xvfb for virtual display | |
Xvfb $DISPLAY -screen 0 1280x1024x16 & | |
# Wait for Xvfb to start | |
sleep 2 | |
# Start Fluxbox as a minimal window manager | |
fluxbox & | |
# Start x11vnc with logging and retry mechanism | |
x11vnc -display $DISPLAY -nopw -forever -shared -rfbport $VNC_PORT -o $X11VNC_LOG & | |
# Wait for x11vnc to initialize | |
sleep 2 | |
# Start noVNC to provide web access | |
/usr/share/novnc/utils/launch.sh --vnc localhost:$VNC_PORT --listen $NOVNC_PORT & | |
# Start Google Chrome with DBUS disabled | |
google-chrome --no-sandbox --disable-gpu --disable-dev-shm-usage --disable-session-crashed-bubble --no-first-run --display=$DISPLAY |