Skip to content

Commit b925c84

Browse files
MohsinHashmi-DataInnDeveloperclaude
authored
feat(devcontainer): add vnc server auto-start on workspace start (#473)
* docs: add vnc browser documentation - Add VNC section to devcontainer README with access instructions - Update Coder README with VNC URLs and usage examples - Add VNC to architecture diagrams and service tables - Document Playwright headed mode testing workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(devcontainer): add vnc server auto-start on workspace start - Add VNC auto-start in post-start.sh (Xvfb, x11vnc, noVNC) - Add VNC to development servers output section - Add VNC log path and stop command to help text 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Developer <developer@simpleaccounts.io> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b861ffd commit b925c84

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.devcontainer/post-start.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,31 @@ CONFIGEOF
161161
fi
162162
fi
163163

164+
# Start VNC server for browser testing and UI preview
165+
if command -v Xvfb &> /dev/null && command -v x11vnc &> /dev/null; then
166+
if ! pgrep -f "Xvfb" > /dev/null; then
167+
echo "🖥️ Starting VNC server..."
168+
# Start Xvfb (Virtual Framebuffer)
169+
Xvfb :99 -screen 0 1400x900x24 > /tmp/xvfb.log 2>&1 &
170+
sleep 2
171+
export DISPLAY=:99
172+
# Start x11vnc
173+
x11vnc -display :99 -forever -nopw -shared -rfbport 5900 > /tmp/x11vnc.log 2>&1 &
174+
sleep 1
175+
# Start noVNC (web-based VNC client)
176+
if [ -f /usr/share/novnc/utils/novnc_proxy ]; then
177+
/usr/share/novnc/utils/novnc_proxy --vnc localhost:5900 --listen 6080 > /tmp/novnc.log 2>&1 &
178+
elif command -v websockify &> /dev/null; then
179+
websockify --web /usr/share/novnc 6080 localhost:5900 > /tmp/novnc.log 2>&1 &
180+
fi
181+
echo "✅ VNC server started on port 6080"
182+
else
183+
echo "✅ VNC server already running"
184+
fi
185+
else
186+
echo "⚠️ VNC packages not installed, skipping VNC auto-start"
187+
fi
188+
164189
# =============================================================================
165190
# Traefik Integration (Dev-Server only)
166191
# =============================================================================
@@ -353,13 +378,16 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
353378
echo " Frontend: http://localhost:3000 (React + Vite)"
354379
echo " Backend: http://localhost:8080 (Spring Boot)"
355380
echo " Swagger: http://localhost:8080/swagger-ui.html"
381+
echo " VNC: http://localhost:6080/vnc.html (Browser Testing)"
356382
echo ""
357383
echo "📋 View logs:"
358384
echo " Frontend: tail -f /tmp/frontend.log"
359385
echo " Backend: tail -f /tmp/backend.log"
386+
echo " VNC: tail -f /tmp/novnc.log"
360387
echo ""
361388
echo "🛑 Stop servers:"
362389
echo " pkill -f vite (stop frontend)"
363390
echo " pkill -f spring-boot:run (stop backend)"
391+
echo " pkill -f Xvfb (stop VNC)"
364392
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
365393
echo ""

0 commit comments

Comments
 (0)