Skip to content

Can project homes on a data disk survive a new system disk?

Answered 2026-10-12: yes, with conditions. Decided 2026-10-12: 1A and 2A. The decisions are in the I22I22 (closed): X08-data-disk: Data disk for homesCan guest user homes live on a second disk and survive a replacement of the system disk? comment that starts Decision (2026-10-12):. I228I228 (closed): X08-data-disk follow-up: measure that a host-made data volume stays unencrypted and returns freed spaceX08-data-disk (PR #227) recommends option A: the host formats the data disk as APFS. measured the assumptions (B228-data-disk-followupB228-data-disk-followup: Does the host-made data volume stay unencrypted and give freed space back?Encryption stays off and the confined format works.). Source: X08-data-diskX08-data-disk: Data disk for homesGuest user homes on a second disk, surviving a system-disk replacement. (I22I22 (closed): X08-data-disk: Data disk for homesCan guest user homes live on a second disk and survive a replacement of the system disk?). Changes S06-03-image-updatesS06-03-image-updates: Image UpdatesHow a VM gets a new image's system disk while its data disk and project users stay, and the guest admin password of each VM., 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. and S06-08-projects-and-sessionsS06-08-projects-and-sessions: Projects and Sessions Inside a VMHow projects map onto guest users and sessions onto worktrees, and how Claude Code runs in the guest. and S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. (wb-diskfmt). Related: I44I44 (closed): S06-vm-lifecycle: data disk durability, and never mount a guest-written diskS06-vm-lifecycle says the data disk "can be rebuilt from host state plus git, so it may use relaxed write-through settings for speed". (the host-mount control), I138I138 (closed): S06-vm-lifecycle: wb-guestd can't delete a macOS user record (eDSPermissionError)S06-vm-lifecycle says wb-guestd creates, locks and removes project users. (deleting a project user’s record), I135I135 (closed): S06-vm-lifecycle: check claude --continue and the trust prompt across session worktreesThe spec change for #46 (S06-vm-lifecycle, "Projects and sessions inside a VM") gives each session a new worktree at <home/sessions/<session-id. (Claude Code’s state layout in a guest), I218I218 (closed): S04-architecture, S06-vm-lifecycle: one wb-vmd per VM and a fixed install entry, from B64-vmd-sandboxThe maintainer decided the two points of B64-vmd-sandbox on 2026-10-12, in the #64 comment that starts Decision (2026-10-12):. (also edits the S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. launcher table). Follow-ups: I228I228 (closed): X08-data-disk follow-up: measure that a host-made data volume stays unencrypted and returns freed spaceX08-data-disk (PR #227) recommends option A: the host formats the data disk as APFS. (does a host-made volume stay unencrypted and give space back, and does a confined diskutil format), I229I229 (closed): S05-cli: a command that gives a VM a new data diskFound in the review of #227 (X08-data-disk). (a command for a new data disk).

wb-diskfmtformats a blank imagehost state per userUID, GID, GeneratedUIDguest (untrusted)old system disk, auxthe guest key needs thesenew system diskwb-guestd recreates usersdata disk: homesnosuid, nodev, ownersbefore the first bootguest APFS: key heremounts host APFS

Figure 1. The guest’s own APFS volume needs a key that the new system disk and auxiliary storage couldn’t unwrap. The volume wb-diskfmt makes on the blank image has no such key. The new system disk mounts it, and wb-guestd recreates the users from the IDs wb-hostd kept (X08-data-diskX08-data-disk: Data disk for homesGuest user homes on a second disk, surviving a system-disk replacement., S06-03-image-updatesS06-03-image-updates: Image UpdatesHow a VM gets a new image's system disk while its data disk and project users stay, and the guest admin password of each VM., “Updates”).

Both options of decision 1 come with the same guest-side controls in 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 data volume found by the UUID the host recorded, mounted nosuid and nodev with ownership on, its flags read again before every session, the volume root and every home checked with lstat, and user IDs that the host allocates and never reuses for any project on any data disk of this host.

The formatting process creates the image under a temporary name with O_CREAT|O_EXCL, attaches it with diskutil image attach --noMount, checks that the device is backed by that file, and runs diskutil eraseDisk APFS. That mounts the new, empty volume on the host once. It records the volume UUID, unmounts and detaches it, and renames the file to its final name. A file at the final name is never attached again.

wb-guestd formats the blank disk Mac OS Extended. HFS+ has no encryption at rest, and was kept across the swap the same way.

Decision 2: which host process runs the format?

Section titled “Decision 2: which host process runs the format?”

With option A, some host process runs diskutil. wb-hostd can’t under its self-sandbox, which starts only the fixed wb-launcher entries, with no arguments (S04-03-self-sandboxingS04-03-self-sandboxing: Self-SandboxingHow each host daemon confines itself at startup, and the wb-launcher that starts confined programs on macOS., “Each host daemon is self-sandboxed”).

Let wb-hostd run diskutil itself.

Requirement1A. Host APFS1B. Guest HFS+1C. Guest APFS
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. Claude Code state persists per projectkept after a swapkept after a swaplost at each swap
SEC08-proj-isolationSEC08-proj-isolation: Per-project isolationEach project has its own guest user, state and history, and one project cannot persist into another. one project can’t persist into anotherwith the guest-side controlssamenothing is kept
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 gets nothing from the hostwhat guest root wrote to the data disk stays after a swapsamenothing stays
SEC12-least-privilegeSEC12-least-privilege: Least privilege on the hostNo root or administrator rights at run time and no extra host user accounts. host processes hold only what they needwith decision 2Ahost does nothinghost does nothing
NFR02-fs-speedNFR02-fs-speed: FilesystemThe workspace is on guest-native storage. filesystem speed goalAPFS, as measured in X05-fs-benchmarkX05-fs-benchmark: Filesystem benchmarkData disk with default versus relaxed write-through settings, against the host, on the NFR02-fs-speed workloads.not measuredas measured in X05-fs-benchmarkX05-fs-benchmark: Filesystem benchmarkData disk with default versus relaxed write-through settings, against the host, on the NFR02-fs-speed workloads.

I44I44 (closed): S06-vm-lifecycle: data disk durability, and never mount a guest-written diskS06-vm-lifecycle says the data disk "can be rebuilt from host state plus git, so it may use relaxed write-through settings for speed". (the data disk settings and the host-mount control), the update path in 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., and the project user code of wb-guestd in 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….

Details and glossary

Why the guest’s own volume is lost. On Apple Silicon, macOS encrypts every APFS volume on an internal disk, even with FileVault off, using keys the Secure Enclave guards. In a VM the Secure Enclave is virtual. The data disk looks internal to the guest, so its volume gets such a key. A fresh clone of the image, with its own system disk and auxiliary storage, couldn’t open the old volume.

Why the host’s volume is different. On the host, a disk image is not internal storage, so the APFS volume diskutil makes on it isn’t encrypted at rest. The guest mounts it as it is, and wb-guestd refuses it if that ever changes.

Why the IDs matter. Files belong to a numeric UID and GID, so a recreated user with the same numbers owns its home again. ACL entries name a user by its GeneratedUID instead, so that has to match too. If another project’s user got the same numbers, it would own the old home, so wb-hostd never reuses them.

Why the mount options. Guest root can leave a setuid-root program in a home. If the data volume allowed setuid, the project user could run it and become root, also on a new system disk. nosuid stops that, nodev stops device files, and ownership on makes the guest honor the owners on the volume. Guest root can change the flags in place, but gains nothing, because it is already root. wb-guestd reads them again before each session.

  • GeneratedUID: the UUID macOS gives each user and group, used in ACLs.
  • ACL: access control list, extra allow and deny rules on a file beyond its mode.
  • Auxiliary storage: a VM’s small extra file that holds its firmware settings.
  • Disk Arbitration: the macOS service that mounts disks at boot.
  • TCC: macOS’s privacy controls, which ask a person or MDM before a process can use protected data such as external disks.
  • HFS+: the macOS filesystem before APFS, still supported.