Skip to content

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.

  • The work VM hosts every project whose placement is work.
  • The isolated VM hosts projects whose placement is isolated, and sessions started with wb --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..

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 build and swift 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.).

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 test of 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.

Such a test fails with a testmanagerd error, which doesn’t name the limit. No host process rewrites that error:

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.):

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 (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”).

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.

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.):

  1. wb project rm;
  2. wb project place isolated in 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.

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).).

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.

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.

Status: Draft