-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·26 lines (20 loc) · 885 Bytes
/
start.sh
File metadata and controls
executable file
·26 lines (20 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Make sure xfce-xstartup is executable
chmod +x /workspaces/codespaces-vm/utils/xfce-xstartup
# Kill previous VNC session
vncserver -kill :1 2>/dev/null || true
fuser -k 6080/tcp
# Set VNC password (change 'YOUR_PASSWORD_HERE' to your desired password)
mkdir -p ~/.vnc
echo "YOUR_PASSWORD_HERE" | vncpasswd -f > ~/.vnc/passwd
chmod 600 ~/.vnc/passwd
# Start VNC server with password authentication
vncserver :1 -SecurityTypes VncAuth -geometry 1280x800 -depth 24 \
-xstartup /workspaces/codespaces-vm/utils/xfce-xstartup -rfbport 5900
sleep 1
# Start noVNC proxy
cd /workspaces/codespaces-vm/noVNC || exit
./utils/novnc_proxy --vnc 127.0.0.1:5900 --listen 0.0.0.0:6080
# Success Message
clear
echo "\n\n✅ Start successful. Navigate to Ports, click the Globe icon next to 6080 and go to vnc.html to connect. You can start this again later using ./start.sh\n\n"