1# ext-mantikafasi
2
3`ext-mantikafasi` is a macOS 26.6 Tart VM (cloned from Cirrus's `macos-tahoe-base`, 8 vCPU, 16 GiB,
4100 GB) for someone outside the house who has no Mac. It is reachable from the internet through Snow
5Globe and cannot reach anything on the LAN. Its Tart home, `private/ext-mantikafasi`, holds the
6account password (`password`), the WireGuard keys, and `run.log`.
7
8```
9internet ──UPnP──> Snow Globe :2222 ─DNAT─> 10.100.0.2:22 (sshd)
10 Snow Globe :5900 ─DNAT─> 10.100.0.2:5900 (Screen Sharing, Apple ARD login)
11 │ wg-ext 10.100.0.1 ▲ WireGuard over the tailnet, UDP 51820 on tailscale0
12 ▼ │
13 Mac NAT ── Softnet (only 100.64.0.1/32 allowed) ── guest utun 10.100.0.2
14```
15
16- **Why a tunnel:** Tart's NAT on this Mac only leaves through Tailscale, so a guest otherwise has no internet.
17 Softnet lets the guest reach exactly Snow Globe's tailnet address; WireGuard (`ext-mantikafasi/up`, started by a
18 LaunchDaemon) carries all its traffic to Snow Globe, which NATs it out. Inbound SSH and VNC ride the same
19 tunnel, so the Mac needs no listeners and no host-to-guest route.
20- **Isolation:** the guest is root on its own box but is enforced from outside it. Softnet limits what leaves
21 the Mac; `nixos/ext-mantikafasi.nix` drops new connections from `wg-ext` to `10.0.0.0/8`, `172.16.0.0/12`,
22 `192.168.0.0/16`, `100.64.0.0/10`, `169.254.0.0/16` and to port 25, and refuses all traffic to Snow Globe itself.
23 The guest's egress address is Snow Globe's public one.
24- **Ports:** `config/ext-mantikafasi.json` owns the public ports; the `public-ports` unit maps them on the
25 router. VNC is unencrypted past login, so tell the user to tunnel it:
26 `ssh -p 2222 -L 5900:localhost:5900 admin@snowglobe.paperclover.net`, then connect to `localhost:5900`.
27- **Run it:** `runtime/control/start-ext-mantikafasi` (copy of `ext-mantikafasi/start`) starts it; the
28 `net.paperclover.ext-mantikafasi-revive` LaunchAgent restarts it every 30 s unless
29 `private/ext-mantikafasi/stopped` exists (`tart stop` plus `touch` that file to stop it on purpose; `start` clears it).
30 Softnet cuts the Mac off from the guest, so maintain it over the public SSH port or `tart exec`.
31- **Guest files:** `ext-mantikafasi/{up,net.paperclover.ext-wg.plist}` install to `/usr/local/libexec/ext-wg/`
32 and `/Library/LaunchDaemons`; the WireGuard config with the private key is `/etc/ext-wg.conf`. `wireguard-go`
33 and `wg` were built with nix for aarch64-darwin. Snow Globe's side of the keys is `/var/lib/snowglobe/ext-mantikafasi/`.
34- **macOS VM limit:** Apple allows two macOS guests at once; `gui-agent` is the other, so `m3-phoenix-box` stays stopped.
35- **Xcode:** Xcode 27.1 (copied from `gui-agent` with `ditto`, license accepted, first-launch components installed)
36 and the iOS 27.1 simulator runtime (the disk image from `gui-agent`'s `/Library/Developer/CoreSimulator/Images`,
37 added with `simctl runtime add`). Xcode 27.1 needs macOS 26.6 or later, which is why the box is on Tahoe. Cirrus's
38 `base` images have no recovery partition, so an in-place upgrade from Sequoia fails with "Failed to find SFR
39 recovery volume"; recreate from the Tahoe image instead. No Apple ID is signed in. Simulator is `DeviceHub.app`
40 inside Xcode, and its only device type for iOS 27.1 is iPhone Duo; headless `xcrun simctl io <device> screenshot`
41 returns black, so capture through Device Hub or the desktop.
42- **SIP:** disabled, as shipped in Cirrus's base images; there is no recovery partition to re-enable it from.