Skip to content

[Playground] Add MicroVM/Hyperlight FS+Network scenarios and harden raw-config#373

Merged
huzaifa-d merged 11 commits into
mainfrom
user/modanish/Sandbox-NV
May 21, 2026
Merged

[Playground] Add MicroVM/Hyperlight FS+Network scenarios and harden raw-config#373
huzaifa-d merged 11 commits into
mainfrom
user/modanish/Sandbox-NV

Conversation

@huzaifa-d

@huzaifa-d huzaifa-d commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds MicroVM and Hyperlight backends, adds new filesystem and networking scenarios, and fixes several correctness issues uncovered by code review.

Scenarios

  • New networking / filesystem pseudo-shells to categorise Python-backed scenarios that exercise net/FS surface (badges, labels, and dropdown options added; hidden outside MicroVM/Hyperlight).
  • New MicroVM scenarios: mv-fs-write-read, mv-fs-list-dir (mount a dedicated C:\Users\Public\MXCPlaygroundTests subdir with try/finally cleanup), mv-stdlib-broad, mv-memory.
  • New Hyperlight scenarios: socket API, network stdlib modules, real HTTP GET (allow), HTTP GET (blocked), stdlib breadth, numpy, memory.

Copilot AI review requested due to automatic review settings May 21, 2026 18:05

This comment was marked as outdated.

huzaifa-msft and others added 5 commits May 21, 2026 11:15
- Add MicroVM (NanVix) scenarios: hello, stdlib, fibonacci, large output, exit code, error, timeout
- Add PowerShell 5.1 scenarios for Windows Sandbox
- Unified WS/MicroVM execution path via runSandboxRaw
- MicroVM containment handler: Python-only runtime, hidden policy, auto-experimental
- MicroVM CWD resolution to nanvixd binary directory
- Runtime dropdown filtering per containment backend
- Dev sidebar and JSON panels show raw config for both backends
- Remove diagnostic logging

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Hyperlight containment backend to SDK types and ExperimentalBackends
- Add Hyperlight option to playground containment dropdown
- Add 11 Hyperlight test scenarios (quick tests, error cases, networking, filesystem)
- Fix platform check bypass: skipPlatformCheck now skips both platform
  support checks in helper.ts (was only skipping one)
- Hide Advanced settings (Isolation, System settings) for VM backends
- Hide Desktop UI Access section for VM backends (Win32k is irrelevant)
- Update permissions summary to show VM-level isolation instead of
  misleading Files/Internet/Desktop toggles
- Update platform badge to show backend-appropriate message instead of
  Windows build version warning for HL/MV
- Merge scenario network policy into raw config for HL scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
…aw-config

- Add networking/filesystem pseudo-shells and new MicroVM/Hyperlight scenarios
  (FS write/read+list, stdlib breadth, numpy, memory, socket API, net stdlib,
  HTTP allow/block).
- Extract buildRawBackendConfig() shared by runSandbox() and updateDevSidebar()
  so the dev preview matches what is actually sent.
- Hyperlight default-block: emit network.defaultPolicy=block when scenario does
  not opt in, in both built-config and raw-JSON paths (closes a default-allow
  regression). MicroVM/NanVix left untouched since it rejects defaultPolicy=block.
- MicroVM FS scenarios now mount a dedicated C:\Users\Public\MXCPlaygroundTests
  subdir, pre-created via mxc.ensureDirs, with try/finally cleanup so no debris
  is copied back. Abort the run if ensureDirs fails.
- Restore PTY line buffering and strip trailing CR from CRLF chunks.
- Run All filter pulls in pseudo-shell scenarios when python is selected on a
  raw backend (MicroVM/Hyperlight).
- Keep networking/filesystem options hidden in AppContainer/WS/other modes so
  they cannot be selected outside MicroVM/Hyperlight.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread sdk/package.json Outdated
Comment thread sdk/src/platform.ts
Comment thread playground/src/renderer/app.ts Outdated
Comment thread playground/src/renderer/app.ts Outdated
huzaifa-d and others added 3 commits May 21, 2026 12:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/mxc/sessions/41f8f439-6a8a-44d7-a1d8-3ba7b078ed66

Co-authored-by: huzaifa-d <16077119+huzaifa-d@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment thread sdk/src/helper.ts Outdated
Comment thread sdk/src/platform.ts
Comment thread playground/src/renderer/app.ts
Comment thread playground/src/renderer/app.ts
Comment thread playground/src/renderer/app.ts Outdated
Comment thread playground/src/main/main.ts
- Playground: reuse buildRawBackendConfig() in showJsonPanel() so the JSON
  preview matches what is actually sent (was building a minimal {containment,
  process} object that omitted scenario filesystem mounts and the Hyperlight
  default-block injection).
- Playground: preserve blank lines in PTY output for fidelity with stdout
  (still strip trailing CR from CRLF).
- Playground: update stale MicroVM/Hyperlight comments to reflect that the
  policy-generator UI is hidden, but scenarios can still set filesystem and
  network in the raw config.
- Playground main: derive arch/target-triple dynamically when locating
  nanvixd.exe (was hardcoded to x64 + flat target dir) and fail early with
  an actionable error if not found.
- SDK helper: keep the microvm Windows-only guard active even when
  `skipPlatformCheck` is set; it's a hard backend requirement (WHP/Hyper-V)
  not a build-version compatibility check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread sdk/src/helper.ts Outdated
Comment thread sdk/src/platform.ts
- sdk/helper.ts: drop the inner shadowing redeclaration of `isExperimental`;
  reuse the variable from the outer scope (already in scope on line 147).
- sdk/platform.ts: `dism /online` typically requires elevation, so on a
  non-elevated session the catch silently cached Windows Sandbox as
  unavailable. Fall back to checking for `%SystemRoot%\System32\WindowsSandbox.exe`,
  which is only present when the Containers-DisposableClientVM feature is
  enabled and is readable without admin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@huzaifa-d huzaifa-d merged commit dfff680 into main May 21, 2026
18 checks passed
@huzaifa-d huzaifa-d deleted the user/modanish/Sandbox-NV branch May 21, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants