#!/bin/bash export DISPLAY=:1 export HOST_IP=$(hostname -I | awk '{print $1}') # Cleanup previous locks rm -rf /tmp/.X1-lock /tmp/.X11-unix/X1 echo "Starting Xvnc on :1..." Xvnc :1 -geometry 1280x720 -depth 24 -rfbauth ~/.vnc/passwd -rfbport 5901 & PID_XVNC=$! sleep 2 echo "Starting Chromium..." # Run Chromium in standard maximized mode (allows address bar) chromium --no-sandbox --display=:1 --window-position=0,0 --window-size=1280,720 --start-maximized --no-first-run --no-default-browser-check --test-type https://google.com & echo "Starting noVNC..." # noVNC (websockify) maps port 6080 to VNC port 5901 websockify -D --web=/usr/share/novnc 6080 localhost:5901 echo "=================================================" echo "Access your browser at: http://$HOST_IP:6080/vnc.html" echo "VNC Password: (configured)" echo "=================================================" wait $PID_XVNC