---
name: nvx-run-microvm
description: "Boot an NVX microVM with nvx on Linux/KVM, Linux/MSHV, or Windows/WHP, exercise the guest, and debug failed boots. Use for boot smoke tests, guest shell sessions, virtio-fs mounts, networking, kernel command lines, missing boot markers, OpenVMM errors, guest hangs, and benchmark acceptance failures."
argument-hint: "[local|host-profile] [kvm|mshv|whp] [run options or failure]"
title: nvx-run-microvm
canonical_url: https://skilld.dev/gh/microsoft/nvx/nvx-run-microvm
last_updated: 2026-11-17T22:02:29.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install microsoft/nvx/nvx-run-microvm`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/nvx-run-microvm`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/microsoft/nvx/nvx-run-microvm) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/nvx-run-microvm`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/nvx-run-microvm --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/nvx-run-microvm --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Run And Debug An NVX MicroVM

Prepare the host with [nvx-prepare-host](../nvx-prepare-host/SKILL.md) first,
and reuse its host, checkout, backend, revision, and artifacts. Run the
commands below from that checkout in an interactive terminal, locally or in
`ssh -tt <ssh_target>` on a remote host. They read the same in bash and
PowerShell, except where noted; use `python` instead of `python3` on Windows.

## Run

1. Assemble the run with only the options that the task needs, and check it:

   ```console
   nvx/target/release/nvx run --hypervisor BACKEND --dry-run
   ```

   [Usage](../../../doc/usage.md#run) documents the options, such as
   `--memory-mib`, `--net 10.0.0.2/24 --network-profile portable`,
   `--cmdline "quiet loglevel=0"`, and `--mount "/mnt/host,HOST_PATH,ro"`, whose
   guest path is absolute and whose mode follows the last comma, so the host
   path may hold commas. Mount `ro` unless the guest must write.
2. From the checkout that holds this skill, since the prepared one may predate
   the probe, check that no OpenVMM process runs, with
   `python3 scripts/nvx_hosts.py probe HOST --cwd CHECKOUT --no-verify` on a
   remote host, or `python3 scripts/host_probe.py --repo CHECKOUT --no-verify`
   locally. Start a competing VM only when the user confirms that the
   existing one is expected and that the host has room for both.
3. Run the same command without `--dry-run`, with standard input attached to
   the guest; never pipe it through a logger.
4. Success is the guest's `NVX-GUEST-BOOT-OK: <guest>` marker, such as
   `NVX-GUEST-BOOT-OK: alpine` for the default guest, and a responsive root
   shell. Exercise the request, exit with `/sbin/nvx-exit 0` in the guest, and
   record the host's exit status. When the guest hangs, interrupt only the
   command that this terminal started; never run a host-wide `killall` or an
   unscoped `Stop-Process`.

## Debug A Failure

1. Before retrying, keep the baseline: local or SSH execution, the host,
   backend, platform, commit, dirty state, artifact source, Python version, the
   `--dry-run` output, the exact command, its exit status and complete error,
   and any OpenVMM process left behind.
2. Change one variable at a time. Rerun the same command with OpenVMM logging,
   `export OPENVMM_LOG=debug` in bash or `$env:OPENVMM_LOG = 'debug'` in
   PowerShell, and use `trace` only when `debug` does not show the failing
   component. The terminal transcript is the record.
3. Run the OpenVMM command that `--dry-run` prints directly only for options
   that `nvx` lacks, and record every deviation.
4. Reduce a benchmark acceptance failure to one run before changing the
   measured suite:
   `python3 scripts/nvx.py benchmark --suite e2e --backend BACKEND --warmups 1 --runs 1 --skip-build --output <fresh file>`.
   The benchmark suppresses most OpenVMM logging to protect its measurements,
   so reproduce the boot through `run` for traces.

| Failure | Action |
| --- | --- |
| SSH authentication or host key | Stop; the user repairs trust or credentials |
| Missing or inaccessible hypervisor device | Report the probe's check; do not elevate |
| WHP unavailable | Report it; enabling WHP needs an administrator and a reboot |
| Dirty or wrong revision | Stop changing it; use a temporary worktree or ask |
| Missing artifacts | `download` or build them, by the provenance that the task needs |
| Boot marker timeout | Trace the same backend and command before widening the scope |
| SSH disconnect | Look for the original process and its output before another run |

## Report

Report local or SSH execution, the host, backend, commit, dirty state, artifact
source, exact command, boot marker, guest checks, and the host's exit status.
For a failure, add the smallest reproduction, the observed against the expected
behavior, the relevant trace lines, the layer that appears to control the
failure, the next discriminating check, every changed option, and any privilege
or transport limitation.
