Skip to content

S15-04 - The Guest Admin User

Purpose: How the host keeps the password of the guest admin user wbadmin, from the image build to each VM’s first contact.

The provisioning options create the user wbadmin. It is the volume’s only secure-token holder, which macOS refuses to delete (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?).

wbadmin stays in the image as a host-administered account (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”):

  • disabled;
  • hidden;
  • without a shell;
  • out of admin.

The host keeps its password in the store, and the secure token keeps working.

That keeps SEC11-root-gains-nothingSEC11-root-gains-nothing: Guest root is not a privilegeFull control of the guest grants no control over enforcement, secrets, or policy.: guest root gains no control over the host, because the asset never leaves its VM.

  • The password and the token unlock only that VM’s disk.
  • Nothing they unlock crosses the Virtualization boundary.
  • No VM can reach another VM’s wbadmin.
  • Guest root can’t read the password back. The guest keeps only what macOS keeps for any account, and the build deletes wbadmin’s keychains before sealing.

wb-guestadmin (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.) does each step below, and only it reads or writes wbadmin/*.

The admin path for the person at the host’s terminal doesn’t use wbadmin or its password (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.).

wb-guestadmin-build generates the build password and writes wbadmin/build/<build>. Then:

  1. wb-hostd creates two pipes.
  2. wb-launcher hands one read end to the build’s wb-vmd, and the other to wb-build-ssh as its standard input.
  3. Once Install has finished, wb-guestadmin-build writes the password to the first, and one newline-terminated copy to the second. The password is then in the pipe before the provisioning boot’s start call, which reads it within a short deadline (S04-10-vmd-installS04-10-vmd-install: Installing macOS in `wb-vmd`The wb-vmd-install entry of an image build: its install rules, the restore image it reads, the build bundle it installs into, and its Install call., “The build password pipe”).

wb-build-ssh (S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh.) speaks SSH in its own process, with Go’s SSH library. It doesn’t run an ssh program or an askpass helper.

  • It logs in as wbadmin with SSH password authentication, using the line from its standard input, and offers no other method.
  • It writes the same password into the session’s standard input, where the guest’s sudo -S reads it.
  • It doesn’t request a terminal.

The session installs wb-guestd and writes cron’s and at’s allow files, and does nothing else. As a Remote Login session it has Full Disk Access, which writing those files needs and wb-guestd lacks (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., “Guest confinement”).

The session runs only on the build VM’s own file-handle network, through the host’s userspace stack. wb-netd connects to the guest’s port 22 for the build VM only, and hands the socket on (S07-18-build-networkS07-18-build-network: Build NetworkThe build VM's network: what its wb-netd serves, the one connection to the guest's port 22, and its refusal for session VMs.). No third party can join that network, so the channel authenticates the guest (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.).

wb-build-ssh therefore doesn’t check the guest’s host key. It accepts the key the guest offers, and logs its fingerprint. The design relies on this (“What first contact relies on”).

A session that doesn’t complete, or that passes one of its deadlines (S04-05-helper-programsS04-05-helper-programs: Helper ProgramsThe programs that run once for an image build or a store operation: wb-guestadmin, wb-release-check, wb-download and wb-build-ssh., “Deadlines”), burns the build password:

  • the build fails;
  • its bundle is deleted;
  • cleanup removes its items.

The build never writes the password into the build bundle, and its test searches the bundle for it.

Every system disk is a clone of the image. At first contact in each fresh clone, wb-guestadmin-rotate runs before any other request. It runs before wb-hostd sends the time, and before wb-guestd lists its sessions (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.).

  1. It refuses when the store already holds wbadmin/vm/<vm>/<disk>, whatever wb-hostd or the guest reports.
  2. Otherwise it fetches the image’s item, and generates the new password.
  3. It writes wbadmin/vm/<vm>/<disk>.
  4. It sends the old and new password to wb-guestd, on a host-guest connection of its own. That connection goes to a port below 1024 that serves only this. It never reads from that connection.
  5. wb-guestd, as root, enables wbadmin. It runs sysadminctl -resetPasswordFor wbadmin -newPassword - -adminUser wbadmin -adminPassword - with both passwords on standard input. Then it disables wbadmin again, and reports the result to wb-hostd.
  6. On success, wb-hostd marks the VM item current.

The build VM rotates the same way, from the build password to the image password.

The layer VM of a Claude Code layer build rotates the same way, from the parent’s password to the new image’s (S06-01-image-layersS06-01-image-layers: Image Layers and the Toolchain PrefixThe layers of a guest image, and the toolchain prefix that project layers install into., “The Claude Code layer”). There, wb-guestadmin-rotate:

  • refuses when the store already holds the new image’s item;
  • fetches the parent’s item, and generates the new image’s password;
  • writes wbadmin/image/<image> for the new image, in place of a VM item, before it sends both passwords.

So each image has a password of its own, and the parent’s password opens nothing in the images built on it, or in their VMs.

On a failed report or no answer:

  • both items stay;
  • wb-hostd marks the disk “rotation unknown”;
  • every session start in that VM is refused with the rule admin-rotation-unknown.

Recovery replaces the system disk, and cleanup removes the disk’s item.

wb-guestd is honest at first contact. The disk is a fresh clone of a sealed image, and no project code has run on it.

Nothing from the data disk runs before rotation. wb-guestd starts no project process and no session until rotation has succeeded, and no user is logged in.

wbadmin is enabled only during the reset, when nothing else runs that could use it. C09-guest-and-sessionsC09-guest-and-sessions: Guest and SessionsThe test cases for what a project user can reach inside the guest, wb-guestd's update and the guest clock, the shared toolchain prefix, the guest admin password, and the session lifecycle. has the conformance case.

The build’s SSH session relies on its channel, not on a host key. The channel is the build VM’s own file-handle attachment to wb-netd’s stack, so the only peer wb-build-ssh can reach is the build guest behind that stack. To sit in the middle, an attacker would already have to control a host process on that path: wb-vmd, wb-netd or wb-hostd. A fresh build guest also has no host key the host could know in advance.

When wb-guestd is dead or wedged, wb-hostd replaces the VM’s system disk with a fresh clone of the image. The data disk stays, and first contact rotates again. No password is fetched and nobody logs in. wb-guestadmin-cleanup removes the old disk’s item.

What guest root wrote to the data disk stays through break-glass (T18-data-disk-persistenceT18-data-disk-persistence: Guest root persists on the data diskAn update and break-glass replace a VM's system disk (and, for an update, its auxiliary storage), and keep its data disk (S06-03-image-updates, "Updates", and S15-04-guest-admin, "Break-glass").).

The same replacement runs at the next start of a VM whose system disk the admin path marked (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach., “Marked”). To look inside a VM before its disk is replaced, the person at the host’s terminal uses the admin path, whose guest end runs apart from wb-guestd.

wb-vmd refuses provisioning options unless its slot is build. That is the slot of wb-vmd-install, whose only bundle is the new build bundle under <data>/images/. The layer slot of wb-vmd-layer uses the same bundle and refuses them. It logs vmd-provisioning-refused (S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves.).

wb-launcher and wb-guestadmin accept only requests whose fields are item names in the fixed format of S15-03-access-rulesS15-03-access-rules: Access RulesHow each host process gets only the credentials it needs, for only as long as it needs them, and which process may access which item., “Declared access”. Each refusal is logged with its rule.

No step of this page goes through wb-guestroot’s port, and the admin path fetches no wbadmin/* item (S15-05-admin-pathS15-05-admin-path: The Admin PathHow the person at the host's terminal gets a root shell in their own guest, on a path that no agent, session, or guest process can start or reach.).

The image has no automatic login, no /etc/kcpassword, and no keychain of wbadmin’s. The sealing scan checks that (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 password on standard input, not through a terminal

Section titled “The password on standard input, not through a terminal”

wb-build-ssh gets the build password on its standard input, logs in with it, and writes it into the session’s standard input for sudo -S. It never answers a prompt through a terminal.

  • Why: the password then never passes through a terminal stream, and no askpass program sits between the pipe and the login.

Status: Draft