Skip to content

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

host/Applications/Xcode.appthe user’s own Xcoderuntimes folderexported by the userwb-diskfmt, Xcode entrychecks signatures, licensewrites the Xcode diskbuild VM, no networkwb-guestd, as rootcopy, check signaturelicense, first launchimport runtimes, sealread-only

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.

The build refuses with xcode-license-not-accepted unless the host’s record says you accepted the license of this exact Xcode build. The guest then accepts it for the copy. An image with Xcode never leaves this Mac, and wb image build says once that it copies your Xcode into the image.

  • Cost: after each Xcode update you open Xcode once, or run sudo xcodebuild -license, before the next build.
  • Controls: none touched.

The build runs xcodebuild -license accept in the guest without looking at the host, and says so.

  • Cost: none for you. Wraith Box accepts a license on your behalf that you may never have seen for that version.
  • Controls: none touched.

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.

You run xcodebuild -downloadPlatform iOS -exportPath <data>/xcode-runtimes once on the host. The build checks Apple’s signature on each runtime and puts it on the same read-only disk, and root imports it in the guest.

The build VM gets a network and downloads the runtime itself, as X06-guest-xcodeX06-guest-xcode: Guest users and XcodeCan builds and simulators run for a guest user without a GUI login? did.

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.

RequirementA + CB + 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 guesta disk image, read-onlysame
SEC05-default-denySEC05-default-deny: Default-deny egress, enforced on the hostOnly allowlisted hostnames are reachable. only allowlisted hosts are reachablebuild VM has no networkpass 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 diskhost-made, never reopenedsame
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 guestbuilds and simulatorssame

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?

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