Create start.sh
Browse files
start.sh
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# 1. Set the VNC password (optional, defaults to 'password')
|
| 4 |
+
export VNC_PASSWD=${VNC_PASSWD:-password}
|
| 5 |
+
|
| 6 |
+
# 2. Start the Virtual Framebuffer (The fake monitor)
|
| 7 |
+
# 1280x720 is a safe resolution for browser windows
|
| 8 |
+
Xvfb :1 -screen 0 1280x720x16 &
|
| 9 |
+
export DISPLAY=:1
|
| 10 |
+
sleep 2
|
| 11 |
+
|
| 12 |
+
# 3. Start the Window Manager (XFCE)
|
| 13 |
+
startxfce4 &
|
| 14 |
+
sleep 2
|
| 15 |
+
|
| 16 |
+
# 4. Start the VNC Server (Connects to the display)
|
| 17 |
+
# We store the password in a file for x11vnc to use
|
| 18 |
+
mkdir -p ~/.vnc
|
| 19 |
+
x11vnc -storepasswd "$VNC_PASSWD" ~/.vnc/passwd
|
| 20 |
+
x11vnc -display :1 -rfbauth ~/.vnc/passwd -forever -shared -bg
|
| 21 |
+
|
| 22 |
+
# 5. Start NoVNC (The Web Interface)
|
| 23 |
+
# This proxies the VNC data to the HTTP port 7860
|
| 24 |
+
# We verify the location of websockify (it varies by distro, this finds it)
|
| 25 |
+
WEBSOCKIFY_PATH=$(which websockify 2>/dev/null || echo "/usr/lib/novnc/utils/websockify")
|
| 26 |
+
|
| 27 |
+
echo "Starting NoVNC on port 7860..."
|
| 28 |
+
# Use the python implementation of websockify to bridge the gap
|
| 29 |
+
/usr/share/novnc/utils/launch.sh --vnc localhost:5900 --listen 7860
|