VM Runner is a Go-based CTF session platform for launching QEMU-backed challenge VMs, validating submissions, and exposing sessions over WebSocket or noVNC.
- Serial Terminal: PTY-based interaction using
xterm.jsover WebSockets. Ideal for CLI-centric challenges with high-speed text interaction. - VNC Graphical Mode: Full graphical support via
noVNCfor GUI-based OSs, featuring absolute mouse synchronization and scaling.
- Static flags: direct comparison against stored challenge flags.
- HMAC flags: per-session deterministic flag generation from the session seed.
- Dynamic Port Allocation: Automated port searching for VNC/WS per session for better concurrency.
- Buffered output: terminal output is preserved so reconnects can recover the runtime stream.
- Message batching: WebSocket updates are batched to reduce terminal repaint churn.
- History buffering: the backend keeps a rolling output buffer for reconnects.
- Overlay cleanup: per-session runtime directories keep VM state isolated.
- Cross-Copy Support: Integrated support for host-to-guest and guest-to-host clipboard synchronization via
qemu-vdagent(requiresspice-vdagentin the guest OS).
- Backend: Go (
net/http,gorilla/websocket,creack/pty). - Frontend: Vanilla JavaScript with
xterm.jsandnoVNC. - Storage: JSON-backed CTF/challenge configs under
data/ctfs/. - Virtualization: QEMU with optional KVM acceleration and per-session overlays.
- Go 1.25+
- QEMU installed and in your system PATH.
qemu-imgavailable for qcow2 overlays.
- Clone the repository.
- Build the server:
go build -o server ./cmd/server/main.go
- Build the VM runner CLI (for inclusion in guest images):
go build -o vmrunner ./cmd/vmrunner/main.go
- Build a challenge qcow2 from an ISO by following
docs/ISO_TO_QCOW2.md. - Define your CTFs in the web maker or in
data/ctfs/*.json. - Start the server:
./server
- Access the dashboard at
http://localhost:8080.
GET /api/ctfsPOST /api/ctfsPUT /api/ctfs/:idPOST /api/uploads/qcow2POST /api/ctfs/:id/publishPOST /api/ctfs/:id/disablePOST /api/challengesPOST /api/sessionsGET /api/sessions/:idPOST /api/sessions/:id/stopPOST /api/sessions/:id/submit-answerWS /ws/session/:id
- Networking Isolation: Implement Tap/Bridge networking with firewall rules to isolate guest VMs from each other and the host network.
- User Authentication: Support for multiple users with secure session management and persistence.
- Resource Quotas: Fine-grained CPU and memory limiting per challenge session.
- Advanced Guest Integration: Automated resolution resizing based on browser viewport dimensions using SPICE guest agents.