How does an image get full Xcode and the simulator runtimes?
Awaiting decision. Source: I194I194 (closed): Xcode image variant: getting Xcode and simulator runtimes into the imageFrom the X06-guest-xcode result (#20)., 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.. Changes 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., S06-04-vms-and-placementS06-04-vms-and-placement: VMs and PlacementThe work VM and the isolated VM, Xcode in them, and which VM a project's sessions run in., S06-06-devices-and-warm-startS06-06-devices-and-warm-start: Devices, Warm Start and TimeA VM's devices and resources, saving and restoring its state, and how the guest clock follows the host., S06-12-guest-agentS06-12-guest-agent: Guest AgentWhat wb-guestd, the service in the guest, does for the host, and how it updates itself., S04-architectureS04-architecture: ArchitectureName the processes, the boundaries between them, and which requirement each boundary serves. (wb-diskfmt-xcode), T00-indexT00-indexboundary 6 is the host terminal stream. (“Trusted”). Follows B20-guest-xcodeB20-guest-xcode: Can Xcode builds, tests and simulators run for a project user without a GUI login?Yes, with conditions.. Follow-up: I624I624 (closed): S06-14-xcode-image: measure the host export, signature checks and offline import of Xcode and runtimesFrom #194 (S06-14-xcode-image, the Xcode image variant). (measurements).
Figure 1. The host checks and copies, and the guest installs. No directory of the host is shared with the guest. The guest doesn’t reach Apple’s servers either.
Options
Section titled “Options”The license
Section titled “The license”The case for B. A host that has Xcode installed and has run it has almost always accepted the license. A adds a check that rarely fails. Recommendation A, with medium confidence. It would change if I624I624 (closed): S06-14-xcode-image: measure the host export, signature checks and offline import of Xcode and runtimesFrom #194 (S06-14-xcode-image, the Xcode image variant). finds the host’s record too hard to read without running xcodebuild.
The runtimes
Section titled “The runtimes”The case for D. No step for the user, and the guest gets exactly what Xcode asks for. Recommendation C, with high confidence: D needs the build VM’s network and a pass exception that today’s rules forbid.
Impact
Section titled “Impact”| Requirement | A + C | B + D |
|---|---|---|
| SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise. no host directory in the guest | a disk image, read-only | same |
| SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable. only allowlisted hosts are reachable | build VM has no network | pass hosts in the build |
| 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. the host never mounts a guest-written disk | host-made, never reopened | same |
| FR06-native-toolsFR06-native-tools: Native guest toolsAgent tool calls run tools native to the guest operating system (on macOS guests: Homebrew packages, Xcode command line tools, optionally full Xcode). full Xcode in the guest | builds and simulators | same |
A question on 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.. 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. lets the host format a blank image it created before any guest has run with it. The Xcode disk relies on that exception, as the data disk does, but the shim also fills the volume before any guest runs with it, as the bundle build fills the guest tools disk. The spec reads the exception as covering that fill, and doesn’t change 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.’s text. Should 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. say “format and fill”, to match what both disks do?
Evidence
Section titled “Evidence”- verified Copying the host’s Xcode from a read-only raw disk, then
-license acceptand-runFirstLaunchas root, worked without an Apple ID in 202 s. Source: X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login?, “Measurements”. - verified
xcodebuild -downloadPlatform iOSdidn’t need an Apple ID in the guest (8.05 GB, 1202 s). Source: same. - verified The Layer 2 build profile reads
/Library/Developer, which the first launch fills. Source: S13-02-filesystem-profileS13-02-filesystem-profile: Layer 2: Seatbelt Filesystem Profile (v1)The Seatbelt profile each session's process tree runs under, where it comes from, its exceptions for Xcode builds, and its known gaps., “Xcode build profile”. - inferred Only root can write
/Library/Developer, so a project user can’t run the first launch. Source: 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. (project users aren’t admins). - assumed That Xcode from the App Store and from Apple’s developer site both meet the code requirement in 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., “The checks on the host”: Apple’s App Store signature, or a Developer ID with Apple’s team
59GAB85EFG. A plainanchor apple genericis never accepted, because any developer’s Developer ID meets it. I624I624 (closed): S06-14-xcode-image: measure the host export, signature checks and offline import of Xcode and runtimesFrom #194 (S06-14-xcode-image, the Xcode image variant). measures both installs. - assumed That
-exportPathworks on the host without an Apple ID, that an exported runtime has a signature the host can check, and that-importPlatformworks offline from a read-only disk. I624I624 (closed): S06-14-xcode-image: measure the host export, signature checks and offline import of Xcode and runtimesFrom #194 (S06-14-xcode-image, the Xcode image variant). measures each, and the build refuses until the checks are known.
What this unblocks
Section titled “What this unblocks”- IMG.8, the Xcode variant, in V1-M7-image-buildV1-M7-image-build: Image buildwb image build downloads the restore image and the Command Line Tools, installs and provisions a VM over the build network, installs the minimal base layer, and installs Claude Code in its own top layer..
- The simulator profile of B20-guest-xcodeB20-guest-xcode: Can Xcode builds, tests and simulators run for a project user without a GUI login?Yes, with conditions. decision 2 (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.) gets images with runtimes.
Details and glossary
Why not a shared folder. Sharing a host folder with the guest is what SEC02-no-host-fs-shareSEC02-no-host-fs-share: No host filesystem sharingNo host directory is mounted into the guest, read-only or otherwise. forbids. A disk image the host builds is a copy, attached read-only, and deleted after the build.
Why copy the app again in the guest. The guest disk is read-only and is detached after the build. Xcode has to be on the image’s own disk.
Glossary
- Simulator runtime: the iOS system that the iOS simulator boots, about 8 GB, installed separately from Xcode.
- First launch:
xcodebuild -runFirstLaunch, which installs the system parts Xcode needs into/Library. - Pass mode: a host whose TLS traffic
wb-proxydforwards without inspecting it (S07-07-hosts-and-modesS07-07-hosts-and-modes: Hosts and ModesHow wb-proxyd binds a stream to its name, which upstream addresses it refuses, and the inspect, pass and audit modes.).