Skip to content

Can wb-vmd hand guest connections to our Go daemons as descriptors, also across a restore?

Answered 2026-10-05: yes, with conditions. Decided 2026-10-06: A, the host opens every connection. The decision and its reasons are in the I29I29 (closed): X18-vsock-handoff: Host-guest socket and descriptor hand-offX18-vsock-handoff (added to S11-verification-and-spikes in #14) comment that starts Decision (2026-10-06):. Source: X18-vsock-handoffX18-vsock-handoff: Host-guest socket and descriptor hand-offCan wb-guestd, written in Go, open AFVSOCK sockets in a macOS guest? (I29I29 (closed): X18-vsock-handoff: Host-guest socket and descriptor hand-offX18-vsock-handoff (added to S11-verification-and-spikes in #14)). Changes 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., S08-workspace-and-gitS08-workspace-and-git: Workspace and Git Round TripHow code gets into the guest and how the agent's work gets back out, without sharing the host filesystem., 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…, 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. and S13-guest-confinementS13-guest-confinement: Guest ConfinementControls inside the guest that narrow what a project user's processes can do, and tell the host which program opened each connection.. Follow-ups: I86I86 (open): Cold boot to wb-guestd takes about 11 s, above the NFR01-startup ceilingFound by X18-vsock-handoff (#29)., and I101I101 (closed): X27-vsock-confinement: vsock confinement of project usersThe B29-vsock-handoff decision (#29) is that the host opens every host-guest connection., which checks that a project user can’t open, bind or listen on vsock and pose as wb-guestd.

guest (untrusted)wb-guestdvsock, Goguest kernelnetwork deviceVirtualizationApple’s service processwb-vmdpasses, then closeswb-hostdwb-netddescriptor + portsdescriptor

Figure 1. Guest bytes go between our Go daemons and the guest through Apple’s Virtualization service process, never through wb-vmd’s code. wb-vmd only creates the connections and hands them over (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.). At a restore every vsock connection ends, and wb-hostd connects again (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.).

The hand-off itself needs no choice: wb-vmd passes each vsock descriptor with its ports, and the network socket end, over a socketpair that carries one descriptor per message, then closes its copies. wb-hostd routes only on the destination port, which it chose, and reconnects to wb-guestd after every restore. A relay in wb-vmd, the fallback the issue named, isn’t needed.

The decision: may the guest open connections to the host? (decided: A)

Section titled “The decision: may the guest open connections to the host? (decided: A)”

Any process in the guest that can open a vsock socket can dial a listener on the host, and it picks its own source port. So a connection that the guest opens says nothing trustworthy about which project or session it belongs to.

wb-vmd registers no host listener. wb-hostd asks wb-vmd to connect to wb-guestd, including after each restore.

The host hands wb-guestd a one-time nonce per session over a host-opened connection. A guest-opened connection must present it first, and is closed on a mismatch.

RequirementA. Host opens allB. Nonce
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. suspended VM within 7 s to the prompt4.1 s to wb-guestd, idle guestsame
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. hard ceiling 10 s (p95)cold boot p95 13.5 s to the listener, not yet to the prompt, I86I86 (open): Cold boot to wb-guestd takes about 11 s, above the NFR01-startup ceilingFound by X18-vsock-handoff (#29).same
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. projects can’t reach each other’s sessionsno guest-opened connectionnonce must stay with wb-guestd
SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. each process gets only what it needsguest bytes stay out of wb-vmd’s code pathsame
SEC13-bounded-resourcesSEC13-bounded-resources: Bounded resourcesCPU, memory and disk of each VM are capped. capped resourcesnothing to acceptcaps in wb-vmd and wb-hostd

The wb-vmd and wb-guestd contracts in I52I52 (closed): S04-architecture, S09-policy-credentials-audit, S10-tech-stack: first .proto contracts and settings schemaS04-architecture says all IPC is protobuf over gRPC and S10-tech-stack adds proto/ "with the first RPC"., the vsock RPCs of the walking skeleton (V1-M2-walking-skeletonV1-M2-walking-skeleton: Walking skeletonwb-vmd boots a fixture VM bundle in its confined process, wb-guestd answers over vsock, a data disk made on the host holds the homes, and wb shell opens a PTY as a project user, with its output through the terminal fi…), and X17-image-buildX17-image-build: Unattended image buildCan a macOS guest installed from an Apple restore image get past Setup Assistant, with wb-guestd running as a root LaunchDaemon, without SSH, scripted clicks, or MDM? (I28I28 (closed): X17-image-build: Unattended image buildX17-image-build (added to S11-verification-and-spikes in #14)), which gets evidence that VZMacGuestProvisioningOptions works on a macOS 27 host and guest.

Details and glossary

The descriptor is a Unix socket. On the host, socket(AF_VSOCK) fails: only Virtualization talks to the virtual device. It hands each connection out as one end of a Unix socket and copies bytes to the device itself. So the bytes stay out of wb-vmd’s code path, but they do go through Apple’s service process, as they would with any design on macOS.

wb-vmd sends the ports with the descriptor. The process that gets a Unix socket can’t ask it which vsock port it came from. wb-vmd reads the ports from VZVirtioSocketConnection and sends them along, and wb-hostd decides which service a connection reaches by that port.

A restore ends every connection. It creates a new VM process. The old VM’s connections die with it, and the guest, which resumes with its old memory, finds its side of each connection closed. Its listener still works, so wb-hostd connects again.

How the daemon got into the guest. The spike used the macOS 27 provisioning options to create a user with remote login on the first boot. It then copied the daemon in over SSH and shut the guest down, 40 s in all. That is a spike shortcut: the product’s image build is X17-image-buildX17-image-build: Unattended image buildCan a macOS guest installed from an Apple restore image get past Setup Assistant, with wb-guestd running as a root LaunchDaemon, without SSH, scripted clicks, or MDM?, and no product image may descend from these bundles, which have remote login on and an admin user with a password.

  • vsock: the host-guest socket, a direct channel between the host and the guest that doesn’t go through the network.
  • Descriptor: a number a process uses to refer to an open socket or file. A process can send one to another over a Unix socket (SCM_RIGHTS).
  • Half-close: one side says it’s done sending, and can still receive.
  • p50, p95: the median, and the value 95% of runs stay under.