Skip to content

State 1 macOS VM: minimal tart image and root launchd render path check (B6) #70

Open

Description

@djbclark

Build work queued by the 2026-11-14 rulings (recorded in #62): B6 sub 1 (state 1's Mac is an Apple Silicon macOS VM via tart on bigmac), its rider (minimise the VM image: smallest vanilla base, strip what state 1 does not need), and B6 sub 3 (the VM runs tendcf as a root LaunchDaemon; "State 1 must verify the root launchd render path", map §12).

Research only so far (web, 2026-11-15; no VM booted, no macOS CI run). Full report with sources: lead state file macos-vm-image-research.md (agent-reports/bfe5e91a).

Findings

  1. Base: ghcr.io/cirruslabs/macos-golden-gate-vanilla:27.2 (macOS 27.2, SIP on, about 30 GB compressed / 35 GB sparse). Pin by tag and digest. Not base (SIP off, Homebrew/Ruby/node to strip) or xcode (+47 GB). bigmac (MacBookPro18,1) runs macOS 27.2 with tart 2.41.1, so the macOS 27 image runs there (checked locally).
  2. Floor: the Signed System Volume puts the floor at about 30 GB. Stripping the Data volume saves an estimated 1-3 GB at most (unverified). Keep the shipped 50 GB disk; 40 GB is the practical minimum and tart set --disk-size only grows.
  3. Never csrutil disable, csrutil authenticated-root disable, or delete under /System: it breaks the seal/SIP for no real size win, and the VM is an enforcing trust boundary. A root LaunchDaemon in /Library/LaunchDaemons needs SIP on, not off.
  4. Strip pass (one scripted SSH pass, kept in the repo, applied to a clone of the pinned tag, saved as state1-golden; clone per run): replace admin/admin with a key, no Homebrew/Xcode CLT unless a test needs them, Spotlight off (mdutil -a -i off), automatic updates off, launchctl disable non-essential agents after listing (snapshot first), Gatekeeper on unless unsigned binaries must run. Recovery-partition deletion (~5 GB) needs a Packer from-IPSW build: phase 2 only.
  5. Access: vanilla has no tart-guest-agent, so no tart exec; use SSH. Apple's licence allows 2 concurrent macOS VMs per host.
  6. Python >= 3.14 (B12 follow-up): available everywhere tendcf needs it: Termux python 3.14.10, python.org 3.14.10 pkg (system-wide, root-readable), Homebrew python@3.14 3.14.10, uv python install 3.14.

Root launchd render path: verification checklist

Run in a fresh clone over SSH, no GUI:

  1. Clone state1-golden, tart run --no-graphics, tart ip --wait 60, wait for SSH.
  2. sw_vers 27.x; csrutil status enabled; sudo -n sh -c 'id -u' is 0.
  3. Install the tendcf build under test to its root-owned path; binary and policy dir root:wheel, not group/world writable.
  4. Render as root in enforcing mode: /Library/LaunchDaemons/<label>.plist, root:wheel, 0644, plutil -lint passes.
  5. Compare with the golden render from bigmac's dry-run (user LaunchAgent) path: differences only where intended (domain, path, UserName).
  6. launchctl bootstrap system ... exits 0; launchctl print system/<label> shows the expected program/arguments; kickstart -k and check its evidence.
  7. Idempotency: a re-run reports no change, plist hash unchanged, no needless reload.
  8. Drift: edit one key as root, re-run: repaired and reloaded (bootout, bootstrap), print shows the repaired values.
  9. Negative: a non-root run refuses to enforce (dry-run only); non-root bootstrap system fails.
  10. Reboot the VM: print system/<label> proves it loads from disk at boot.
  11. Bootout, remove, confirm print fails, stop and delete the clone. At most 2 macOS VMs at once throughout.

Every macOS run needs the djbclark-ade lead's go-ahead first (standing rule), and no macOS leg in PR checks unless asked by name.

Open questions (operator)

  1. "Smaller": compressed pull size, host disk, or registry storage? Beyond choosing vanilla, only ~1-3 GB is reducible.
  2. Is SSH enough, or is tart exec (guest agent, larger image) wanted?
  3. May the image replace admin/admin and re-enable Gatekeeper, or do tests need unsigned binaries?
  4. Is deleting the Recovery partition acceptable (needs a from-IPSW build; no in-guest recovery boot)?
  5. Does the review TUI (Python >= 3.14) run inside the VM? If so: python.org pkg (system-wide) or uv?
  6. The exact tendcf command that renders and installs the root plist (checklist step 4), and which golden render step 5 compares against: this is defined when the launchd renderer lands.
  7. Does CI run the same image (self-hosted GitHub runner or Forgejo on bigmac)? That decides whether the image needs a runner or guest agent and how the 2-VM cap is shared.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions