S06-04 - VMs and Placement
Purpose: The work VM and the isolated VM, Xcode in them, and which VM a project’s sessions run in.
Design
Section titled “Design”The work VM and the isolated VM
Section titled “The work VM and the isolated VM”- The work VM hosts every project whose
placementiswork. - The isolated VM hosts projects whose
placementisisolated, and sessions started withwb --isolated claude.
macOS allows at most two running macOS guests, including any started
by other software. wb-hostd performs admission control, and reports a
clear error when a slot is unavailable (NFR05-two-macos-vmsNFR05-two-macos-vms: Platform limitmacOS permits at most two concurrently running macOS guests per host.). The rules
are in S06-07-slot-admissionS06-07-slot-admission: Slot AdmissionHow wb-hostd admits every macOS VM it starts against the limit of two, and lends the isolated VM's slot to a maintenance VM..
Xcode in the session’s VM
Section titled “Xcode in the session’s VM”These run for a project user without a GUI login session, under the Layer 2 profiles of 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. (X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?):
- Xcode builds;
swift buildandswift test;- signing to run locally.
They run in the VM that the project’s placement picks, and take no
slot of their own. Full Xcode is in an image built with the host’s
Xcode, and root ran Xcode’s first launch in the image build, so a
session never runs it (S06-14-xcode-imageS06-14-xcode-image: The Xcode ImageHow an image gets full Xcode and the simulator runtimes from the host, as a read-only disk the host builds, and who runs Xcode's first launch.).
X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login? also ran iOS simulators and their tests for a project user without a GUI session. Under the Layer 2 profiles specified there, they don’t run (I196I196 (open): Simulators leave the session: per-user launchd domain and the Seatbelt profileFrom the X06-guest-xcode result (#20), for S13-guest-confinement layers 1 and 2.).
No GUI login session
Section titled “No GUI login session”These need a GUI login session (X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?):
- every
xcodebuild testof a macOS target, a SwiftPM package’s included; - launching a macOS app.
Neither VM gives a project user one. Sealing refuses an image with
automatic login or an /etc/kcpassword (S06-02-image-buildS06-02-image-build: Image BuildHow wb image build makes a guest image: the build VM, its two provisioning stages, terminfo, sealing, and storage., “Sealing”). So V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. doesn’t offer macOS tests through xcodebuild, or
launching a macOS app. swift test is unaffected.
Explaining the limit
Section titled “Explaining the limit”Such a test fails with a testmanagerd error, which doesn’t name the
limit. No host process rewrites that error:
xcodebuildruns in a Claude Code tool call. Its output goes to Claude Code in the guest, and from there to the model. Claude Code’s terminal interface draws it, and the terminal stream carries it throughwb-hostdandwbto the user (S16-terminal-streamS16-terminal-stream: Terminal StreamHow wb guards boundary 6 of T00-index, the guest output that wb writes to the user's terminal.). The host passes those bytes on as opaque terminal frames and never parses them.- To see it, the host would parse output a guest-side wrapper sends. That is guest-controlled input, and a parser for it buys only a message.
Claude Code meets the limit in the guest, and the explanation goes there (NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.):
- The image’s guest instructions tell Claude Code that macOS tests
through
xcodebuildand launching a macOS app fail in the guest, why, and thatswift testworks. Claude Code can then tell the user (S14-04-commands-and-endpointsS14-04-commands-and-endpoints: Commands and EndpointsWhich permission mode Claude Code runs in, the commands that don't work in a guest, the guest instructions that explain the guest's limits to Claude Code, and the endpoints Claude Code in the guest may reach., “Guest instructions”). - The user documentation lists the limit on its V1 limits page.
No V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. work needs a console session, so S06-07-slot-admissionS06-07-slot-admission: Slot AdmissionHow wb-hostd admits every macOS VM it starts against the limit of two, and lends the isolated VM's slot to a maintenance VM. has no rule for one. I195I195 (open): macOS app tests need a console session: decide the isolated-VM fallbackFrom the X06-guest-xcode result (#20). holds the console session design for after V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there..
Placement and configuration trust
Section titled “Placement and configuration trust”placement (work or isolated) is a project setting
(S09-03-project-settingsS09-03-project-settings: Project SettingsWhat a project's settings hold, and what a repository's own .wraithbox/ configuration may add., “Settings contents”).
wb project placechanges it (S05-cliS05-cli: Command Line InterfaceSpecify wb, the single user-facing command.).--isolatedoverrides it for one session.config_trust(wb trust) only decides whether.wraithbox/is read. It never moves a project between VMs.
New projects start in the work VM
Section titled “New projects start in the work VM”A newly registered project (FR02-any-repoFR02-any-repo: Any git repositoryWorks in any git repository.) has placement = work. So
it shares the grants of every work-VM project with a session
(T13-new-project-grantsT13-new-project-grants: New projects share the work VM's grantsA newly registered project has placement = work (S06-04-vms-and-placement).). Projects in the work VM still run as
separate guest users.
For a repository they don’t trust, the user passes --isolated, or
sets placement = isolated.
Changing placement
Section titled “Changing placement”A new placement applies from the next session start. wb project place is refused while the project has a session, and the refusal
names the session.
A project user’s home is on the data disk of the VM it ran in (S06-05-disksS06-05-disks: DisksA VM's system disk and data disk: how the data disk keeps what the guest flushes, and how the guest mounts it.). The home holds its Claude Code state (FR13-claude-stateFR13-claude-state: Claude Code state per projectClaude Code's conversation history, and the state it keeps only in the guest, persist per project, so --resume/--continue work within a project.) and commits not yet pushed. The host can’t move it by mounting either data disk (SEC15-no-guest-disk-mountSEC15-no-guest-disk-mount: The host never mounts a guest-written diskA disk image is guest-written once a guest has run with it attached, and every copy or clone of a guest-written image is guest-written too.). I232I232 (open): S06-vm-lifecycle: move a project's home between VM data disks on wb project placeS06-vm-lifecycle, "Changing placement", refuses wb project place for a project that has a home on a VM's data disk, because moving the home to the other VM's data disk "needs the data-disk design of I44". decides whether and how a home moves.
Until I232I232 (open): S06-vm-lifecycle: move a project's home between VM data disks on wb project placeS06-vm-lifecycle, "Changing placement", refuses wb project place for a project that has a home on a VM's data disk, because moving the home to the other VM's data disk "needs the data-disk design of I44". is decided and built, wb project place is refused for a
project that has a home on any VM’s data disk. The refusal names I232I232 (open): S06-vm-lifecycle: move a project's home between VM data disks on wb project placeS06-vm-lifecycle, "Changing placement", refuses wb project place for a project that has a home on a VM's data disk, because moving the home to the other VM's data disk "needs the data-disk design of I44".,
and today’s way to isolate such a project
(NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.):
wb project rm;wb project place isolatedin the repository, which registers it again with no home.
That costs the project its Claude Code state and approvals. In return, no home is left on the old VM, exposed to its other projects (T05-cross-proj-clonesT05-cross-proj-clones: Other projects' clones after guest rootAfter a guest root escalation inside the shared work VM, read or write access to other projects' guest clones (code only; no secrets are present; changes still return only as reviewable branches).). And no session starts with an empty home without saying so.
A new clone, which has no home yet, can still be placed before its first session.
Isolated slot to itself
Section titled “Isolated slot to itself”Projects in one VM share its network grants and credential bindings
(S07-01-per-vm-policyS07-01-per-vm-policy: Enforced per VMWhy the VM is the unit the gateway enforces, how the policies of its projects combine, and what happens when they conflict or change., T11-shared-vm-grantsT11-shared-vm-grants: Projects in one VM share network grantsThe host sees one guest address per VM, and can't tell which project user, session or program opened a connection.). A project whose
placement is isolated gets the isolated VM to itself, unless its
settings mark it shared (S09-03-project-settingsS09-03-project-settings: Project SettingsWhat a project's settings hold, and what a repository's own .wraithbox/ configuration may add., “Settings contents”).
While such a project has a session in the isolated VM, wb-hostd
refuses a session start that would put another project there, or an
--isolated session. It refuses that project’s session start while
another project has one there. The error names the other project
(NFR06-explained-refusalsNFR06-explained-refusals: OperabilityEvery refusal names the rule that caused it and how to change it.).
Sessions started with --isolated, and projects marked shared, may
share the isolated VM with each other. They then share their grants.
After guest root they also share their clones (T05-cross-proj-clonesT05-cross-proj-clones: Other projects' clones after guest rootAfter a guest root escalation inside the shared work VM, read or write access to other projects' guest clones (code only; no secrets are present; changes still return only as reviewable branches).).
Decisions
Section titled “Decisions”No macOS tests through xcodebuild in V1
Section titled “No macOS tests through xcodebuild in V1”V1V1-initial: Initial versionThe first version: what it delivers, what it leaves out, and the milestones that get there. doesn’t offer macOS tests through xcodebuild, or launching a macOS
app, because neither VM has a GUI login session.
- Decided: B20-guest-xcodeB20-guest-xcode: Can Xcode builds, tests and simulators run for a project user without a GUI login?Yes, with conditions., decision 1A (I20I20 (closed): X06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?).
Guest instructions explain the testmanagerd error
Section titled “Guest instructions explain the testmanagerd error”The guest instructions and the user documentation explain the limit. No process rewrites the error.
- Rejected: an
xcodebuildwrapper in the image whose outputwb-hostdparses. The host would parse guest-controlled bytes for a message, and the output reaches the model, notwb. - Decided: I224I224 (closed): S06-vm-lifecycle: which process explains the testmanagerd failure in the guest (B20 decision 1A)S06-vm-lifecycle, "No GUI login session" (B20-guest-xcode decision 1A, #20, PR #221) says wb replaces the testmanagerd error from xcodebuild with a message that names the v1 limit (NFR06-explained-refusals)., triage of 2026-10-16.
work as the default placement
Section titled “work as the default placement”- Decided: I42I42 (closed): S05-cli, S06-vm-lifecycle, S09-policy-credentials-audit: separate configuration trust from VM placement; project identityThe specs use "trusted" for two different things and do not give a default: (B42-trust-placementB42-trust-placement: Where does a new project run, and what makes it the same project later?Split "trusted" into two named settings, start new projects in the isolated VM until the user moves them, and key project identity on the git directory rather than the remote URL.).
Status: Draft