Repository navigation
sandbox: attach only the distro layer - #593
Open
Jay (jay23606) wants to merge 3 commits into
Open
Jay (jay23606) wants to merge 3 commits into
Jay (jay23606) wants to merge 3 commits into
Conversation
Nothing produces or attaches the runtime and custom layers, and the converter that split images into them was removed. NVX now accepts only the distro role, the guest agent mounts only distro, the sandbox-blocks scenario attaches only distro and scratch, and the docs describe one distro layer. OpenVMM still defines the runtime and custom roles and their windows; removing them there is tracked separately in microsoft#556. Refs microsoft#556 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unchanged guest probe still requires four disks and fails with the new two-disk launcher.
1 open issue
What changed in this PR
Implements the NVX portion of #556 by limiting sandbox storage to one read-only distro layer and writable scratch. OpenVMM cleanup and pin promotion remain separate.
Changes:
- Restricts host validation and guest mounting to the distro role.
- Changes the sandbox-blocks launcher to attach two disks.
- Updates unit tests and usage documentation.
| File | Description |
|---|---|
| scripts/test_nvx_tools.py | Tests the distro-only launch contract and role rejection. |
| scripts/test_microvm_tests.py | Expects distro and scratch attachments. |
| scripts/nvx_tools/sandbox.py | Restricts roles and requires exactly one layer. |
| scripts/nvx_tools/microvm_tests.py | Attaches only distro and scratch. |
| guest/common/nvx-init-agent | Removes runtime/custom mounting and stacking. |
| doc/usage.md | Documents the distro-only layer option. |
| doc/run.md | Describes the single-layer sandbox. |
Review effort: Balanced
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
SandboxLaunch validated only the layer count, so a layer built directly (for example by sandbox_lifecycle._deserialize_launch from a saved config) with a runtime or custom role passed validation. ordered_layers() then dropped it, producing scratch-only launch arguments with no nvx_layer token. Reject any role outside LAYER_ROLES in __post_init__ so managed starts fail with a configuration error. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
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.

Refs #556. This is the NVX half of that issue; the OpenVMM removal of the
RuntimeandCustomroles, their slots and status words, and the pin promotion are still open.Summary
runtimeorcustomlayers, and the converter that would split images into them was removed. NVX now accepts only thedistrorole.sandbox.py:LAYER_ROLESis("distro",), the MMIO map keeps onlydistroandscratch, and a sandbox requires exactly one read-only layer.nvx-init-agent: mounts onlydistro, drops theruntimeandcustomlowerdirs and the three-layer limit, and rejects other roles as unknown.sandbox-blocksattaches onlydistroandscratch.doc/usage.mdanddoc/run.mddescribe one distro layer.Not done here
openvmm_defs/src/microvm.rs, the CLI parser, snapshot capture and restore, and the Guide), and promoting the pin. This account can't write tonanvix/openvmm.nvx_layer=custom. The change is in the mount path, and the guest boot tests need a VM.Test
test_layer_parser_rejects_the_runtime_and_custom_rolesfails before the change and passes after.test_launch_contract_builds_agent_command_lineandtest_launch_contract_rejects_duplicates_and_reserved_tokensnow check the distro-only contract; the second expectsexactly onefor two layers.test_sandbox_blocks_use_fixed_roles_and_accessexpects two blocks (distro, scratch) and fails before the change.python -B -m unittest test_nvx_tools: 539 tests, OK (54 skipped, as before). ruff check and format are clean. The guest agent andsandbox-blocks.shpassbash -n.test-microvmboot scenarios.🤖 Generated with Claude Code