Skip to content

Add the microVM VMM launcher (config + process lifecycle)#278

Merged
seanwevans merged 1 commit into
mainfrom
claude/microvm-launcher
Jul 21, 2026
Merged

Add the microVM VMM launcher (config + process lifecycle)#278
seanwevans merged 1 commit into
mainfrom
claude/microvm-launcher

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Summary

Follow-up to the microVM scaffolding (#276): adds the mechanical layer that boots a guest — MicroVMLauncher — so backend="microvm" has a real, tested VMM lifecycle beneath it.

What's included

  • build_command renders the Firecracker argv (--api-sock / --config-file). A ready host running a not-yet-supported VMM (Cloud Hypervisor, QEMU) is reported as MicroVMUnavailable("not implemented") rather than mis-launched.
  • launch() materializes the MicroVMConfig JSON into a per-VM working directory, spawns the VMM process, and returns a LaunchedMicroVM handle (pid, workdir, config/socket paths). The workdir is cleaned up if startup fails.
  • terminate() stops the process (SIGTERM, then kill on timeout) and removes the working directory, and is safe to call after the process has already exited.

Explicitly still out of scope

Booting a guest end-to-end needs KVM and a guest image, and — more importantly — the in-guest agent and the vsock cell transport that carry exec/call/post/recv into the VM. Those remain the next increment. So Supervisor._spawn_microvm still fails closed (with a refreshed message noting the launcher now exists); no working microVM sandbox is returned yet.

How it's tested without KVM

The launcher is driven against a fake VMM — a tiny script that ignores its arguments and sleeps — so CI exercises the real code paths: config materialization (the written JSON matches to_firecracker_json()), command construction, launch → alive → terminate, cleanup-after-exit, and cleanup-on-error (workdir isn't leaked when build_command rejects an unsupported VMM).

README and the threat model are updated to reflect that the launcher exists but the guest agent/transport is pending.

Full suite: 498 passed, 6 skipped. black/isort/flake8/mypy clean; pylint 9.50 (gate 8.0).

🤖 Generated with Claude Code


Generated by Claude Code

Follow-up to the microVM scaffolding (#276): add the mechanical layer that boots
a guest -- MicroVMLauncher -- so the backend has a real, tested VMM lifecycle
beneath it.

- MicroVMLauncher.build_command renders the Firecracker argv (--api-sock /
  --config-file); a ready host running a not-yet-supported VMM is reported as
  unimplemented rather than mis-launched.
- launch() materializes the MicroVMConfig JSON into a per-VM working directory,
  spawns the VMM process, and returns a LaunchedMicroVM handle; the workdir is
  cleaned up if startup fails.
- terminate() stops the process (SIGTERM, then kill on timeout) and removes the
  working directory, and is safe to call after the process has already exited.

Booting a guest end-to-end still needs KVM and a guest image, so the launcher is
tested against a fake VMM (a script that ignores its args and sleeps): config
materialization, command construction, launch/alive/terminate, cleanup-on-error.

This is only the VMM lifecycle. The in-guest agent and the vsock cell transport
remain the next increment, so Supervisor._spawn_microvm still fails closed with
a refreshed message; no working microVM sandbox is returned yet. README and the
threat model are updated accordingly.

Full suite: 498 passed, 6 skipped. black/isort/flake8/mypy clean; pylint 9.50.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PbbJc7Ntj159D9LNGevwC2
@seanwevans
seanwevans merged commit c1db844 into main Jul 21, 2026
18 checks passed
@seanwevans
seanwevans deleted the claude/microvm-launcher branch July 21, 2026 18:06
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.

2 participants