S12-03 - Host Prerequisites
Purpose: What wb setup checks on each host, and how a development
build on macOS gets signed.
Design
Section titled “Design”Prerequisites
Section titled “Prerequisites”wb setup checks these and explains them to the user. It never changes
them silently.
| Host | Prerequisite | Who can do it |
|---|---|---|
| macOS | Apple Silicon, macOS 27+ | n/a (hardware and OS version) |
| Windows | Virtual Machine Platform optional feature enabled (it is if WSL 2 is installed) | administrator, once |
| Windows | Permission to create VMs through HCS as a standard user | decided by spike X11-windows-hostX11-windows-host: Windows host through HCSOn Windows 11 Home with only the Virtual Machine Platform feature: can a standard user create, start, save, and restore a VM through HCS? |
| Linux | Read-write access to /dev/kvm (desktop sessions usually have it; otherwise the kvm group) |
administrator, once |
A failed check refuses before wb setup installs anything:
- A Mac without Apple Silicon, or with an older macOS, is refused with
setup-host-unsupported. So is a Mac whose CPU or macOS versionwb setupcan’t read. - A host that is later in the platform matrix is refused with
setup-host-later(S12-01-platform-interfacesS12-01-platform-interfaces: Platform InterfacesHow platform-specific code is isolated behind interfaces, and what each host OS uses for each., “Unimplemented platforms fail clearly”).
Spike X11-windows-hostX11-windows-host: Windows host through HCSOn Windows 11 Home with only the Virtual Machine Platform feature: can a standard user create, start, save, and restore a VM through HCS? may show that HCS needs administrator rights for every VM operation. The Windows design then needs a narrowly scoped system service. That would change SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. for Windows. It requires a spec change, not a workaround.
Development builds on macOS
Section titled “Development builds on macOS”A development build has the Keychain backend only when the developer’s own team signs it (S15-02-secret-storeS15-02-secret-store: The Secret StoreWhere credentials are held: the secret store, its backends, and the guarantees a backend must give.; S10-02-packaging-and-signingS10-02-packaging-and-signing: Packaging and SigningHow Wraith Box is packaged and signed on each host, and the one version every build stamps.). The developer sets that up once per Mac, without a paid membership (X29-dev-signingX29-dev-signing: Keychain access group for development buildsCan a developer's free personal team, an Apple ID signed in to Xcode without a paid membership, sign the helpers in Wraith Box.app (wb-proxyd, wb-hostd, wb-vmd) with a keychain-access-groups entitlement and a provisio…):
- Sign in to Xcode with an Apple ID (Xcode, Settings, Accounts). Xcode lists its team as a personal team.
- Build a small app project once in the Xcode app, with that team and
“My Mac” as the destination.
- That registers the Mac with the team. Xcode makes the Apple Development certificate and downloads the profile.
xcodebuildalone can’t register the Mac.- The organizational unit (OU) in the certificate’s subject is the
team ID, the value for
WB_TEAM_ID.
After that, mise run build signs from the command line. The profile
lasts 365 days (X29-dev-signingX29-dev-signing: Keychain access group for development buildsCan a developer's free personal team, an Apple ID signed in to Xcode without a paid membership, sign the helpers in Wraith Box.app (wb-proxyd, wb-hostd, wb-vmd) with a keychain-access-groups entitlement and a provisio…, measured on a team with a lapsed
membership). A second Mac needs both steps too.
wb doesn’t hold an access group. So it starts whatever state the
profiles are in, and reports each case itself.
Ad-hoc signed build
Section titled “Ad-hoc signed build”wb setup refuses the Keychain backend with the rule
keychain-needs-team. It names both steps and WB_TEAM_ID.
Team-signed build
Section titled “Team-signed build”wb setup reads the team from each helper bundle’s code signature,
and decodes each helper’s profile with /usr/bin/security cms -D. It
refuses the Keychain backend with the rule keychain-team-mixed when
the helpers don’t agree on one team:
- two helpers are signed by different teams, or one by a team and another without one;
- a helper’s signature can’t be read;
- a helper’s profile is missing, isn’t a regular file, or can’t be decoded;
- a profile’s
TeamIdentifierisn’t exactly the signature’s team, or itsTeamNameis empty or differs from another helper’s.
Its fix is to build Wraith Box again with WB_TEAM_ID and install it.
Otherwise it prints the team and that the team’s groups are team-wide
(S17-02-setupS17-02-setup: InstallHow wb setup installs Wraith Box from its bundle without administrator rights, and how wb setup --remove takes it out., “The Keychain backend”).
Missing profile
Section titled “Missing profile”A build with WB_TEAM_ID set fails before it makes the bundle when the
app from Xcode has no profile, or one whose TeamIdentifier isn’t
exactly that team. Its message names both steps. macOS then never gets a
bundle it would refuse to start (S10-tech-stackS10-tech-stack: Technology ChoicesFix languages, libraries, packaging, and repository layout, with the reason for each choice.).
Profile within 30 days of its expiry date
Section titled “Profile within 30 days of its expiry date”wb setupandwb statusread the expiry date from the helper bundles’ profiles and print it, with the fix. The fix: build the small project in the Xcode app again for a new profile, then build Wraith Box again.wb-hostdreads the same date from the helpers’ profiles at start, and logs a warning with it.wb claudeprints one line with the date before the session starts.
A bundle without a profile, such as an ad-hoc one, gets none of these checks. Whether a release build has a profile is the assumption in S10-02-packaging-and-signingS10-02-packaging-and-signing: Packaging and SigningHow Wraith Box is packaged and signed on each host, and the one version every build stamps., “Signing”.
Expired profile
Section titled “Expired profile”AMFI refuses to start a program whose profile has expired, as it
refuses one with no profile (assumed in X29-dev-signingX29-dev-signing: Keychain access group for development buildsCan a developer's free personal team, an Apple ID signed in to Xcode without a paid membership, sign the helpers in Wraith Box.app (wb-proxyd, wb-hostd, wb-vmd) with a keychain-access-groups entitlement and a provisio…). The programs
are wb-credset, wb-proxyd and wb-guestadmin.
wb setup,wb statusandwb clauderead the helpers’ profiles. For an expired one they print the date, the rulesigning-profile-expiredand the fix.- When
wb credseeswb-credsetexit onSIGKILL, and its profile has expired, it reports the same.
wb-hostd doesn’t hold a group, so it keeps running. It gives a second
signal:
wb-launcherreports that a program with a group exited onSIGKILL(S04-07-supervisionS04-07-supervision: SupervisionWho starts and restarts each host process, what happens when wb-hostd stops or the bundle is upgraded, and daemon outages., “Who starts whom”).wb-hostdreads that program’sembedded.provisionprofile.- For an expired one, it logs the rule
signing-profile-expiredwith the date.
A SIGKILL of a program whose profile is valid, or that has no
profile, is logged as a plain exit with the signal.
The fix is the one for a profile near its expiry date.
Status: Draft