Repository navigation
Conversation
Each new microVM gets a vsock device (guest CID 3) whose host side is <vmdir>/v.sock, recorded in metadata.json: a guest connection to CID 2, port N arrives at <vmdir>/v.sock_N. It's the channel boxctl-vms's run-status plan (docs/plans/run-status.md there) uses for a box to report to its host without a token, a network path or ssh. - Pause/Resume: the device is in the snapshot, on the VM's own vmDir path, which moves with it; Resume removes a socket left by the previous process, which firecracker would otherwise refuse to bind. - Restart: a cold boot configures it too, so a VM created before this gets one there. - A vmDir too deep for <path>_<port> to fit a Unix socket path (107 bytes) gets no device rather than a failed create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XF91y27tgx4Ycv1WRSHk8D
cdalar
enabled auto-merge (squash)
October 16, 2026 18:41
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1202 +/- ##
==========================================
+ Coverage 39.79% 39.94% +0.14%
==========================================
Files 67 67
Lines 7310 7333 +23
==========================================
+ Hits 2909 2929 +20
- Misses 4401 4404 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Step 2 of boxctl-vms's
docs/plans/run-status.md: a vsock device on every Firecracker microVM, so a box can report to its host without a token, a network path, or ssh.PUT /vsock {"guest_cid": 3, "uds_path": "<vmdir>/v.sock"}before boot (FCVMConfig.VsockPath, recorded asvsockPathinmetadata.json). A guest connection to CID 2, port N arrives at<vmdir>/v.sock_N. Every VM can use CID 3 because each device belongs to its own VM only.vmDirpath, which moves with it on export/import, so novsock_overrideis needed (that override is Firecracker ≥1.16 anyway). Resume removes the socket left by the previous process, which Firecracker would otherwise refuse to bind.vmDirtoo deep for<path>_<port>to fit a Unix socket path (107 bytes) gets no device, not a failed create. On hosts (/opt/fc/vms/<owner>-<name>/) that's ~82 bytes at most.chboxes are mostly Windows and have no Pause/Resume; a follow-up if a Linuxchbox needs the channel.Tested:
go vet,golangci-lint,go test ./..., with new tests for the/vsockcall, Deploy recording the path, Resume removing a stale socket, Restart adding a device to an old VM, and the length guard.Tested live on fc-host (Firecracker v1.16.0, guest kernel 6.1.188) with a throwaway VM on its own state dir and bridge, removed afterwards. A guest sent to CID 2, port 1024, and a
socatlistener on<vmdir>/v.sock_1024received it:pause -f+resume✔ (the oldv.sockwas still there after pausing, and Resume replaced it)pause --hot+resume✔restartof a VM whose metadata had novsockPath(faked pre-vsock VM) ✔: it came back with the device recordedFinding for the host side (boxctl-vms step 3): a guest's half-close (
shutdown(SHUT_WR)) didn't reach the host reader, which waited for EOF and hung. A newline-ended message, read as one line and answered withok\n, works both ways, so the status protocol should end each message with a newline and not wait for EOF.🤖 Generated with Claude Code
https://claude.ai/code/session_01XF91y27tgx4Ycv1WRSHk8D