Repository navigation
stream: make voxl the console, keep noVNC as the fallback - #16
Merged
Merged
Conversation
The console was RFB: correct, but capped at 6-8 FPS because it moves pixels instead of video. voxl encodes the same X display as H.264 and the browser decodes it with WebCodecs — 60 FPS at 12-99 ms on the same hardware — and, unlike the VNC path, its keystrokes actually reach the guest. The guest image now builds voxl from the published crate and starts it beside Xvnc, so the fallback costs one idle process and adds no new failure mode: an image built before voxl, or a browser without WebCodecs, still gets noVNC. /d/ picks whichever console answers and ?classic=1 forces the fallback. - deploy/guest: a voxlbuild stage (glibc-free: it links x264, libyuv, Opus and libpulse), runtime libs on desktop images only, and a pkg-config file for libyuv, which Alpine installs without one. - deploy/guest/init: voxl on :6901 with the same per-VM password as VNC, in the environment rather than on a command line. Readiness now gates on it when it is up, so the first /d/ load does not race it. - internal/api: /voxl/<id>/ proxies the page, websocket, screenshots and /wait. It rewrites Origin, because voxl only answers its own origin and every request through the proxy arrives as the dashboard's; a direct request still keeps its real Origin and is refused. Verified end to end on an arm64 Alpine image: the desktop boots, /d/ selects voxl, ?classic=1 selects noVNC, and /screenshot returns the real 1280x800 frame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes voxl the default console and keeps noVNC as the fallback.
The console was RFB. It was correct, but it moves pixels instead of video, so it capped at 6–8 FPS — the one part of warmbox that did not feel instant. voxl encodes the same X display as H.264 and the browser decodes it with WebCodecs: 60 FPS at 12–99 ms on the same hardware. It also fixes something the VNC path never did — keystrokes reach the guest (voxl injects through XTEST itself).
How the split works
/d/<id>probes the guest's:6901/healthz(400 ms) and serves voxl if it answers, noVNC if not.?classic=1forces noVNC.Notable details
libyuv.pc: Alpine ships libyuv's headers and shared object but no pkg-config file, and voxl's build script requires one. The Dockerfile writes it.Originmatches its own host (anti-DNS-rebinding). Everything through the daemon arrives as the dashboard's origin, so the proxy rewrites it to the address it dials. A direct request keeps its real Origin and is still refused — the guard survives instead of being disabled with--allowed-origins *./procis not).:6901when voxl is up, so the first/d/load does not race it and fall back for no reason.Test plan
Built and booted the real arm64 Alpine image, then drove it through the daemon:
The screenshot returns the actual XFCE desktop (panel, terminal, wallpaper), so capture via MIT-SHM + DAMAGE works under Xvnc. Guest log confirms
keymap: 275 keysymsandXTEST pointer.go build ./...,go vet,go test ./...passdeploy/guest/smoke.shnow reports which console was chosenCaveats (documented in docs/limitations.md)
localhost— WebCodecs requires a secure origin.