Skip to content

Can wb-vmd confine itself and still run a macOS VM?

Answered 2026-10-06. Decided 2026-10-12: 1A and 2A. The decisions are in the I64I64 (closed): X25-vmd-sandbox: Self-sandboxed wb-vmdFound while answering #34 (X23-sandboxed-daemons). comment that starts Decision (2026-10-12):, which also makes the install target a fixed build bundle. The spec changes are I218I218 (closed): S04-architecture, S06-vm-lifecycle: one wb-vmd per VM and a fixed install entry, from B64-vmd-sandboxThe maintainer decided the two points of B64-vmd-sandbox on 2026-10-12, in the #64 comment that starts Decision (2026-10-12):.. Source: X25-vmd-sandboxX25-vmd-sandbox: Self-sandboxed `wb-vmd`Can wb-vmd confine itself at start with a Seatbelt profile that allows the Virtualization framework, its VM bundles under <data>/vms and nothing else, and still create, start, save and restore a macOS VM?, I64I64 (closed): X25-vmd-sandbox: Self-sandboxed wb-vmdFound while answering #34 (X23-sandboxed-daemons).. Affects S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves., S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does., S07-egress-gatewayS07-egress-gateway: Egress GatewayThe only path from a guest to any network: a userspace network stack (wb-netd) and a policy-enforcing proxy (wb-proxyd) on the host., S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq… and S12-platformsS12-platforms: PlatformsWhich host and guest operating systems Wraith Box targets, how platform-specific code is isolated, what each platform uses, and how wb works inside WSL..

wb-launcherwb-vmd profilewb-vmdconfined at startVM bundlesdisks, saved stateVirtualizationApple’s serviceconfiguration, extensionsVM: guest, untrustedguesthost directoryrefused by the profileinternetNAT: only wb-vmd’scode stops it

Figure 1. wb-vmd confines itself after wb-launcher starts it, and keeps access to the VM bundles and Apple’s Virtualization service. The profile refuses a shared host directory, because sharing one needs a sandbox extension the profile denies (SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise.). The service provides a NAT network without any help from wb-vmd’s process. Only wb-vmd’s own check keeps that network from the guest (SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable.).

The spike settled the mechanism: a Seatbelt profile in process, as for the Go daemons. App Sandbox wasn’t needed, and no confinement would weaken SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. (Details). You choose how many wb-vmd processes run, and how one starts to install an image.

Decision 2: how wb-vmd is started to install an image

Section titled “Decision 2: how wb-vmd is started to install an image”

wb-launcher has a wb-vmd-install entry whose compiled-in profile adds the three install rules. The restore image sits at a fixed path under <data>/images/.

Every wb-vmd profile carries the install rules, with the image path as a parameter.

Requirement1A. Per VM1B. Shared
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. untrusted repositories in the isolated VM, apart from the work VMseparate bundlesshared process
SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. least privilege on the hostone bundle eachboth bundles
SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise. no host directory in the guestcode and profilecode and profile
SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable. only allowlisted hosts reachablecode check, verifiedcode check, verified
Warm start (NFR01-startupNFR01-startup: StartupGoals: a warm VM reaches the Claude prompt in about 4 s and a suspended VM in about 7 s, and no start takes more than 10 s (p95), excluding first-time project setup and the first boot after a host restart.)no slowerno slower
Details and glossary

Why NAT gets past the profile. A Seatbelt profile limits what a process does itself: which files it opens, which services it looks up. The Virtualization framework runs the VM in a separate service process that Apple confines with its own profile. For most devices, wb-vmd hands that service a sandbox extension: a token that grants access to a file or a device class. The profile decides which tokens wb-vmd may issue. A NAT network doesn’t need a token, because the service sets it up with Apple’s vmnet on its own. So wb-vmd’s profile has nothing to deny.

Other ways to confine wb-vmd. App Sandbox, set by entitlements at signing, would confine wb-vmd at launch with a container directory. It wasn’t tried, because the in-process profile works. Leaving wb-vmd unconfined would give a bug in it all the user’s files and the network, and would need a spec change, since it weakens SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts..

What the device-set check does. Before every start and restore, wb-vmd compares its own description of the VM with the fixed list in S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does., before it creates any Virtualization object, and refuses anything else with the rule in its log and in the error it returns. It runs first because a disk outside the bundle crashes the confined process when the framework tries to open it. A unit test passes it each refused device, a conformance check in the guest looks for exactly one network interface, and a CI check rejects the NAT, bridged, shared directory and audio input classes in wb-vmd’s code (S11-verification-and-spikesS11-verification-and-spikesthe filter's fuzz properties, including one that replays the filtered output and the exit reset into a headless emulator and checks it is back in its initial state, and a conformance case that prints every dropped seq…, S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.).

Why the CPU name matters. The framework writes facts about the host into the saved state, among them the CPU name, which it reads with sysctl. When the profile denies that read, the saved state records a different value from what an unconfined process sees. The restore then fails with “invalid argument”. With the read allowed, states restore between a confined and an unconfined process in both directions (measured), so a later profile change is less likely to strand them. S06-vm-lifecycleS06-vm-lifecycle: VM Lifecycle, Images and the Guest AgentHow guest images are built, how VMs are kept warm, how projects and sessions map onto guests, and what wb-guestd does. already treats an unexplained “invalid argument” as permanent: the state is deleted and the VM cold boots.

What wb-vmd does before confining. It asks for its cache directory with confstr. libSystem gets the answer from a system service once and keeps it, so the framework’s later call works without that service. Nothing guest-controlled is read before confining.

Glossary

  • Seatbelt: the macOS kernel sandbox. A profile lists what a process may do, and the kernel denies the rest.
  • Sandbox extension: a token one process issues to give another access to a file or a class of device. The issuing process’s profile decides which tokens it may issue.
  • NAT network: a virtual network where the host’s network stack translates the guest’s addresses and forwards its traffic to the internet.
  • virtio-fs: the device that shares a host directory with the guest.
  • vsock: the socket between host and guest that wb-hostd and wb-guestd talk over.
  • Restore image: the file Apple publishes to install macOS into a VM.