Repository navigation
doc: describe live shares in the sandbox filesystem bootstrap - #444
Merged
Merged
Conversation
Since 13d2722, the sandbox init agent has mounted live virtio-fs shares inside the container root, and since c220042 a sandbox can attach two, each in its own fixed virtio-fs slot with its own access mode and host-enforced policy. The sandbox design chapter still listed an assembly that never mounts a share and a teardown that never unmounts one, and it called the managed agent's mapping source "OpenVMM's single virtio-fs export". Add the share mount and unmount steps, the shares in the assembled view, and virtio-fs among the kernel facilities. A new section explains how a share reaches the workload and why the host enforces its policy, and links to the run guide for the options and to the machine ABI for the device contract. The managed agent still maps host directories from one export, so the chapter says so. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation incorrectly attributes single-share policy-path validation to NVX instead of OpenVMM.
1 open finding
What changed in this PR
Documents live virtio-fs shares in the sandbox filesystem bootstrap architecture.
Changes:
- Adds share mounting, teardown, security, and lifecycle details.
- Updates HostFs terminology for multiple filesystem slots.
| File | Description |
|---|---|
doc/design/sandbox-filesystem-and-agent-architecture.md |
Documents live-share bootstrap and managed-sandbox behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+113
to
+114
| no guest configuration. Before OpenVMM starts, NVX rejects a third share and | ||
| policy paths outside their share. It also rejects guest targets or host |
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.

Summary
doc/design/sandbox-filesystem-and-agent-architecture.mddescribes the guestinit agent's filesystem assembly, but it predates the sandbox's live
virtio-fs shares. Since 13d2722 (2026-09-30), the init agent has mounted a
share inside the container root, and since c220042 (2026-10-06) a sandbox can
attach two shares, each in its own fixed virtio-fs slot with its own access
mode and host-enforced policy. None of the later edits to this chapter covered
them. The share commits updated
run.md,usage.md,ci.md, and the ABI,status, and validation chapters, but not this one. As a result, the
chapter's assembly never mounts a share, its teardown never unmounts one, and
it still calls the managed agent's mapping source "OpenVMM's single virtio-fs
export".
This PR brings the implemented-bootstrap section in line with the code. It
adds an architecture-level section on live shares that links to
run.mdfor options and rules and to
machine-and-device-abi.mdfor the device contract, so those facts stay stated in one place. One file
changes, all under
doc/.Changes
NVX paths are relative to the repository root. OpenVMM paths are in the pinned
submodule.
nvx sandboxacceptsMAX_MOUNTS = len(MOUNT_TAGS)withMOUNT_TAGS = ("microvm", "microvm1")(scripts/nvx_tools/sandbox.py).python scripts/nvx.py sandbox --help: "repeat to attach up to 2 shares".scripts/nvx.pyaccepts--mountonly forrunandprovision.CONFIG_FUSE_FS=yandCONFIG_VIRTIO_FS=yinkernel/config-microvm.kernel/config-microvm-debugis a fragment appended to it that only enables watchdogs.guest/common/nvx-init-agentruns the identity checks, thenmount_live_shares, then writes$runtime/workload-machine-id, and only then starts the one-shot child or the managed agent.nvx-container-launchbehind the FIFO, with the PID written to/sys/fs/cgroup/container/cgroup.procsbeforestartis written.teardown()callsunmount_live_shares(most recent first) before it unmounts$rootfs, the layers, and scratch, then callsnvx-exit.stopnvx-managed-agentwith$rootfs, then callsteardown. With layers, the managed agent writes the child to the container cgroup, then releases the barrier, then runsnvx-container-launch(write_pid_to_cgroup,release_container_barrier, andexec_sandboxinguest/common/nvx-managed-agent.c).microvmandmicrovm1mounted at/run/nvx/rootfs/TARGETmount -t virtiofs -o "$share_mode,nosuid,nodev" "$share_tag" "$share_path"in the init agent. Tags fromMOUNT_TAGS.--mountgets its own fixed virtio-fs slot (microvm,microvm1) served by its own HostFs servermicrovm_filesystems_from_mountszips the mounts withMICROVM_FILESYSTEM_SLOTS(openvmm/openvmm_entry/src/microvm/filesystem.rs).openvmm/openvmm_entry/src/microvm/config.rsbuilds oneVirtioFsBackend::HostFsper attached slot with its own policy profile.--mount-owneridentity. Guest flags are not a boundary, and the policy adds no guest tokens.### Filesystemsection ofmachine-and-device-abi.md. The policy pin 3c03d93 and c0961d8 ("adds no bootstrap tokens and no guest changes")._MOUNT_COMMAND_LINE_FRAGMENTcarries onlyvirtfs_dir,virtfs_tag, andvirtfs_mode, and the policy goes to OpenVMM inmounts_openvmm_arguments. Thefilesystem-sharesandfilesystem-policyscenarios expectEROFSfrom OpenVMM even with the tag remounted read-write.validate_mountsandvalidate_mount_host_paths, called fromSandboxLaunch(scripts/nvx_tools/sandbox.py).MODE,nosuid,nodev, and lets the private namespace inherit it. Any refusal aborts with status 125.mount_live_shares,mount_live_share,validate_share_target, andfatal(nvx-exit 125) inguest/common/nvx-init-agent. The entry helpers (guest/alpine/nvx-container-enterandguest/common/nvx-container-enter-azurelinux) mount/proc,/sys,/dev, and/.nvx-agentand bind/etc/machine-id.nvx-container-launchrunsunshare --mountafter the shares are mounted.mountandmountsconfiguration in formats 2 through 5 (scripts/nvx_tools/sandbox_lifecycle.py). Also stated inrun.md.MICROVM_FILESYSTEM_SLOTS: [MicrovmFilesystemSlot; 2](openvmm/openvmm_defs/src/microvm.rs).HOSTFS_ROOTinguest/common/nvx-managed-agent.c, andaci_edge_sandboxes/src/openvmm/filesystem.rspasses a single--mount /run/nvx/hostfs/root,....I left the rest of the section unchanged after rechecking it against the
init agent, the container helpers, and the CLI. That includes block
resolution through
/proc/iomem, the sector, flush, and UUID checks, theoverlay options, the one-to-three-layer rule, the 16 MiB
memory.lowdefault, and the managed-exec option split.
scripts/nvx.pyrejects--cwdand the environment options outsidesandbox exec.OpenVMM SHA:
f12dcf5e8f2ea60cc15899dd16852320530670bd, the gitlink ondevat33bd2fe5ef6006fb665cb5b870fa03b08e828f13. This PR does not changethe gitlink or the submodule.
Follow-ups
These are out of scope here, or blocked by open PRs or unpublished branches:
doc/design/machine-and-device-abi.mdstill makes scratch mandatory("Required writable final role when blocks are present"; "any nonempty
topology ends with scratch"), which contradicts the RAM-backed overlay
layout. The review on doc: sync cold boot with the second share and RAM overlay #442 raised this. Open PRs Support filesystem-only streamed microVM snapshots #417, Adopt bind-once microVM image slots #406, and test-microvm: pause and resume a microVM through OpenVMM state control #405 all
modify that file, so I didn't touch it.
doc/run.md:718says that onstopthe guest agent "unmounts thelive share", but a sandbox can now have two. Open PR Adopt bind-once microVM image slots #406 modifies
run.md.aci_edge_sandboxes/README.md:601says "OpenVMM offers one virtio-fsexport". So does the module comment in
aci_edge_sandboxes/src/openvmm/filesystem.rs, which is code. The backenddoes use one export by design, but OpenVMM now offers two slots. Open PRs
aci_edge_sandboxes: accept execution timeouts up to MXC's maximum #443 and Adopt bind-once microVM image slots #406 modify the README.
component-map row names
aci_edge_sandboxes, its OpenVMM and agentbackends, or its model crate (
git grep aci_edge -- doc/design doc/design.mdreturns nothing).
doc/design/code-ownership-map.mdcould assignhost-side sandbox lifecycle to it.
doc/project-structure.mdanddoc/contribute.mdstill have thedrift listed in doc: sync cold boot with the second share and RAM overlay #442. Local branches
doc-sync/project-structure,doc-sync/contribute-standards, anddoc-sync/contributing-guidewerecommitted on 2026-10-08 but never pushed or opened as PRs. I left those
files alone so this PR wouldn't duplicate them.
scripts/setup/README.mdis documentation outsidedoc/. Moving itmeans editing links in
doc/ci.mdanddoc/setup.md, which open PRs test-microvm: pause and resume a microVM through OpenVMM state control #405and Adopt bind-once microVM image slots #406 modify.
doc/openvmm-upstream-roadmap.mdstill has no inbound links, and itsfork tip
2728f33eais 132 commits behind the pin. It needs an ownerdecision: refresh and index it, or retire it.
unittest_results.txtisstill tracked.
Validation
python -m unittest scripts.test_nvx_tools.CliTests scripts.test_performance.PerformanceTests:Ran 110 tests,OK (skipped=1). The skipped test needs a Linuxpseudo-terminal, and this ran on Windows.
file and every tracked Markdown file that links to it:
doc/design.md,doc/design/cold-boot.md,doc/design/machine-and-device-abi.md,doc/design/snapshot-and-restore.md,doc/guests/ubuntu-guest.md, anddoc/run.md. It confirmed that every relative link and anchor resolves,the changed file has one H1 and balanced code fences, and
doc/design.mdlinks every chapter in
doc/design/. Result: 0 errors. Its self-testreported a planted broken link, broken anchors, a second H1, an unclosed
fence, and an unindexed chapter, and nothing else. The new links resolve:
#live-host-shares(used twice),machine-and-device-abi.md#filesystem,and
../run.md#live-host-directory-shares. The chapter's inbound anchorsare unchanged.
git diff --check: clean.python scripts/nvx.py verify: passes.python scripts/nvx.py classify-ci-changes --event-name pull_requestonthis diff: "Only documentation files changed", and every suite is
false.doc/design/sandbox-filesystem-and-agent-architecture.md, matches^(doc/|.*\.md$). The commit is SSH-signed.