24. Garden Linux under Lima¶
23 put Fedora's floor (806–927 MB idle, kernel and systemd only) above¶
Debian with our whole stack (~700 MB, #18). Gavin (2026-11-25): try Garden
Linux, which is built from Debian, publishes pinned release images, has a
lima platform feature, and takes custom features through its builder.
What Garden Linux offers¶
Read from github.com/gardenlinux/gardenlinux at tag 2150.15.0 (commit
fb5e4ef5, released 2026-11-12), github.com/gardenlinux/builder at the
commit that tag's build script pins (0196add0), and docs.gardenlinux.org:
- Releases carry
lima-arm64-2150.15.0-fb5e4ef5.tar.xz(GitHub release asset, sha2567e185d67…): a qcow2, the package manifest, and a.requirementsfile sayingarch=arm64,uefi=false,secureboot=false. No.lima.yamlis in the release;bin/generate-lima-yaml.pywrites one fromglrd, the release database. Its features (.release):lima,cloud,cloudInit,server,base,ssh,log,_legacy,_fwcfg,_slim; 298 packages: Debian-derived packages from Garden Linux's own apt suite2150.15.0, kernellinux-image-6.18.63-cloud-arm64, systemd 259.11, cloud-init 26.1, openssh-server, sudo, auditd, qemu-guest-agent. features/lima(info.yaml) includescloudandcloudInit, and excludessap,firewalland_selinux.pkg.includeadds openssh-server, qemu-guest-agent, sshfs, efibootmgr and friends;convert.qcow2turns the raw disk into qcow2;exec.configwrites a.lima.yamlbeside the build (containerdoff,mounts: ["~"]read-only,mountTypesUnsupported: [9p], novmType). The docs' how-to and the feature reference name no VM type; the sample manifests name none either, so Lima's default (vz on this Mac) applies.- Boot (
_legacy'sexec.late): dracut--no-hostonlywithkernel-modulesandkernel-modules-extra, xz-compressed, thenkernel-installandbootctl installinto the ESP: systemd-boot on EFI (syslinux only on amd64). The kernel command line comes from/etc/kernel/cmdline.d(console=ttyS0,cgroup_enable=memory swapaccount=1,TIMEOUT=1). - Disk (
base/fstab): an ESP labelledEFIand an ext4ROOT,rw; the builder'smakepartlays out partitions deepest first, addsx-systemd.growfsto/, andcloud'srepart.d/root.conflets systemd-repart grow it. - Read-only: the
_readonlyflag was deleted in September 2024 (commitb1291007, "deprecate _secureboot, _readonly, _trustedboot");_prod's README still names it, and_nopkgis only a README and aninfo.yaml. What remains is thegardenerfeature'sfstab.mod:/usron its own ext4 partition labelledUSR, mountedro. - The builder runs in a container (
ghcr.io/gardenlinux/builder, pinned by commit inbuild); docs.gardenlinux.org's building-images page asks for rootless or rootful Podman or rootless Docker and 8 GiB. A build is./build <platform>-<features>-<arch>;mmdebstrapbootstraps frompackages.gardenlinux.io/gardenlinuxwith the suite named byVERSION(2150.15.0), so the version fixes the package set. A feature is a directory:info.yaml,pkg.include/pkg.exclude,file.include(copied to/, root-owned, the exec bit kept),file.include.stat, thenexec.configandexec.latein the root,file.exclude,fstab.mod(the docs' features reference andbuilder/configure.chroot). - Packages for the must-have list in the
2150.15.0suite (arm64): containerd 2.3.7, runc 1.4.3, containernetworking-plugins 1.1.1 (Debian's, as in #18), nftables 1.1.6, rsync 3.3.0.
Lima 2.3.0's 30-install-packages.sh runs apt-get update and apt-get
install rsync at boot whenever rsync is missing; the release image has no
rsync.
Predictions¶
Written before running. Lima 2.3.0, vmType: vz, arm64, 4 CPUs, 8 GiB,
footprint as #23 (spike/lima_footprint.py).
| Question | Expected |
|---|---|
1. The published lima-arm64-2150.15.0 image under vz: guest agent up, share mounted and writable |
yes, unchanged; the first boot spends 10–20 s on Lima's apt-get install rsync |
| 2a. Stock Garden Linux idle | 600–750 MB: Debian's cloud kernel, but a generic xz initramfs with every module (Debian's cloud image: 17.6 MB) and auditd |
| 2b. Stock Debian 13 idle, same day (#23: 664–666) | 640–700 MB |
| 2c. Breakdown | outside MemTotal within 20 MiB of Debian's 252; guest used 280–380 MiB; the initramfs is the largest difference |
3. Our flavor (lima + allmyram, /usr read-only as gardener does it) passes #22's checks 1, 2 and 4 |
yes after one to three fixes (the guest agent's prefix on a read-only /usr; CNI's plugin directory; something in cloud's sysctls or modprobe blocklist) |
| 4a. Its idle footprint | 700–850 MB |
| 4b. Warm start; start to warden job exited (#17 Debian 4.6–6.8 s; #23 C 7.7–8.1 s) | 5–7 s; 5.5–7.5 s |
| 4c. Fresh instance to job exited (#23 C 11.8–14.1 s) | 9–13 s |
| 4d. Packages (#23 C 271, stock 298) | 300–330 |
| 4e. Image: qcow2 and zstd -10 of the raw (#23 C: 615 MB zstd) | qcow2 550–700 MB; zstd 350–450 MB |
| 4f. Build time | first 10–20 min (builder image, bootstrap), cached 5–10 min |
Setup (2026-11-25)¶
- The MacBook (32 GB) and Lima 2.3.0 as in #23. VMs in scratch
LIMA_HOMEs (/private/tmp/claude-501/v24bfor the build VM,/private/tmp/claude-501/v24for the rest). Every image a local file (the release qcow2, the build's raw, and the Debian 13 cloud image Lima's_images/debian-13pins, downloaded and sha512-checked by hand), so nothing went into Lima's download cache. Another agent ran its own Lima VMs on the Mac at the same time: footprints are per process, but start times are noisy and are given as ranges over repeats. - Stock Garden Linux: the release qcow2 with
spike/gardenlinux/lima-stock.yaml(4 CPUs, 8 GiB, a writable virtiofs share, containerd and port forwards off); stock Debian 13 with the same template. - Our flavor (
spike/gardenlinux/feature/allmyram, built byspike/gardenlinux/build.shaslima-allmyram-arm64): pkg.include: containerd, runc, containernetworking-plugins, nftables, rsync (so Lima's boot script never runs apt);pkg.exclude: qemu-guest-agent and sshfs (no use under vz with virtiofs) and sshguard (thesshfeature's).file.include: #23's sysusers, tmpfiles, warden drop-in, proxy drop-in (After=containerd.service),warden.jsonand containerd config (CNI plugins in Debian's/usr/lib/cni), and a kernel command line drop-in withinit_on_free=0(below).build.shstagesdeploy/linux's units (@SHARE@substituted),egress.nftand the CNI conflist, gVisor release-20261116.0 (install.sh's sha512) and theallmyrambinaries into it.exec.config:systemd-sysusers,containerd config dump, enable containerd and the three allmyram units, masknftables.service,cni-dhcp.socketandcni-dhcp.service.fstab.mod: thegardenerfeature's,/usron its own ext4 partition mountedro.- Lima (
spike/gardenlinux/lima.yaml): #23's template with the raw from the build: 4 CPUs, 8 GiB,disk: 20GiB,guestInstallPrefix: /var/usrlocal(/usr/localis read-only), the share, the socket forward, the ports rule. - Build (
spike/gardenlinux/build.sh): a Debian 13 Lima VM (build-vm.yaml, 4 CPUs, 8 GiB, Debian's podman, nftables for podman's netavark, qemu-utils);git clone --branch 2150.15.0with the commit checked; a check that the tag'sbuildpinsghcr.io/gardenlinux/builder:0196add0…; the feature copied tofeatures/allmyram;sudo ./build lima-allmyram-arm64; the raw zstd -10'd and copied out with the qcow2, the package manifest and the.lima.yaml. - Scripts:
spike/lima_footprint.py(idle,inside) andspike/lima_egress_check.py --image --tools-dir(crictl 1.29.0 from the share) as #23;spike/lima_vm_reset.pygained--templateand reads the image's name from/etc/os-releasewhen there is no bootc.
Raw results¶
1. The published image under vz boots unchanged: a fresh instance was
ready 12.3 s after limactl start, guest agent running, the share
virtiofs rw, written from the VM and read on the Mac. The firmware loads
systemd-boot from the ESP although the release's .requirements says
uefi=false. Lima's boot script installed rsync with apt on the first
boot (about 2 s, /var/log/apt/history.log).
2. As shipped, its footprint is the whole VM. The kernel is built with
CONFIG_INIT_ON_FREE_DEFAULT_ON=y (/boot/config-6.18.63-cloud-arm64);
dmesg: mem auto-init: stack:all(zero), heap alloc:on, heap free:on and
clearing system memory may take some time.... The kernel zeroes every
free page at boot, so the guest touches all 8 GiB, and vz keeps every
touched page (#23: no free page reporting).
| VM (8 GiB, idle, MB) | 30 / 60 / 90 s |
|---|---|
| Stock Garden Linux 2150.15.0 as shipped (first boot, then two warm boots) | 8207; 8206 / 8206 / 8206 twice |
Stock Garden Linux, init_on_free=0 added to its boot entry only (three warm boots) |
630 / 630 / 630, 627 / 631 / 631, 617 / 617 / 617 |
| Stock Debian 13 (three warm boots) | 667 / 669 / 669, 669 / 671 / 671, 677 at 60 s |
| Our flavor, final image (three warm boots) | 776 / 776 / 776, 771 / 771 / 771, 786 / 789 / 789 |
| Our flavor, final image, a fresh instance's first boot | 837 / 843 / 843 |
| Our flavor before dropping sshguard and cni-dhcp (three warm boots) | 791 / 791 / 793, 787 / 787 / 787, 807 / 809 / 809 |
Where the memory goes (lima_footprint.py inside, warm, idle, no job
yet; MiB unless said):
| Debian 13 stock | Garden Linux stock, init_on_free=0 |
Our flavor | #23 C | |
|---|---|---|---|---|
| Outside the guest's MemTotal | 252 | 257 | 257 | 287 |
| Guest used (MemTotal − MemFree) | 284–298 | 310–314 | 458 | 573 |
| of which page cache | 134–135 | 154 | 271 | 312 |
| of which anonymous | 55–69 | 48–52 | 78 | 115 |
| of which slab | 42 | 45–46 | 46 | 82 |
| Host footprint (MB) | 667–677 | 617–631 | 771–789 | 1067–1102 |
| Footprint the guest can't see (≈ footprint − the two above) | ~90–110 | ~20–35 | ~20–35 | ~225 |
| Initramfs (as freed at boot) | 17.6 MB | 15.8 MB | 15.8 MB | 18.2 MB |
Our flavor's cgroups: containerd 92 (78 of it file pages), Lima's guest agent 49, systemd itself 40, the proxy 33 (28 file), udevd 18, the warden 18, the user session 12, sshd 12, journald 10, resolved 6, networkd 4. Stock Garden Linux has the same guest agent, systemd, udevd, session, sshd and journald, plus sshguard 5. Debian's: guest agent 53, unattended-upgrades 13, session 12, sshd 11, resolved 9, udevd 6, journald 6. Above stock Garden Linux, our flavor holds ~150 MB: containerd, the proxy and the warden (~145 MiB with their file pages).
3. Our flavor passes #22's checks 1, 2 and 4 on its first build, with no fix to the boot:
- Check 1 (
lima_vm_reset.py check):/usris/dev/vda1 ext4 ro,touch /usr/bin/xrefused;/ext4 rw, grown to 18.9 GiB; containerd, allmyram-egress, -warden, -proxy, cloud-final and the guest agent active; no failed units; no failed proxy start; the share written by VM root and read on the Mac; the socket0600on the Mac; a warden job exit 0,Completed, uid 882 in gVisor, its CRI log read on the Mac. No SELinux (thelimafeature excludes_selinux); the kernel's LSM list includes AppArmor. - Check 2 (
lima_egress_check.py --image), on both builds: as #18, #22 and #23.https://example.comthrough the proxy 200 ("decision": "allow","rule":"public"); 1.1.1.1:443 and IPv6 network unreachable; the canary at the gateway, the VM, the Mac's three addresses and the VM's sshd network unreachable;10.78.0.1:22and:53timed out (iifname "allmyram-e0" dropcounted 5 and 7 packets); the canary saw nothing. - Check 4 (
lima_vm_reset.py kill), twice on each build: once minutes into the VM's life, once 15 s after a start. Every time: recreate 0.22–0.41 s, warden reachable 8.3–11.4 s afterlimactl start, the same image (GARDENLINUX_CNAME), a new machine-id, the next job exit 0, the killed rununknownto the warden.
What the first build got wrong, found by reading the boot, not by a failed check:
| Problem | Evidence | Fix |
|---|---|---|
| The proxy's unit was mode 0600 | systemd: allmyram-proxy.service is marked world-inaccessible; the sed -i of @SHARE@ in exec.config left the file 0600 |
substitute in build.sh while staging |
nftables.service enabled although exec.config disabled it |
systemctl is-enabled: enabled. Debian's unit loads /etc/nftables.conf, which flushes every ruleset. The ssh feature's exec.config, finding nftables installed, makes sshguard Requires=nftables.service; and a fresh instance's first boot runs systemd's preset-all (journal: Failed to preset all unit: …). Which of the two enabled it was not separated |
mask it; drop sshguard |
cni-dhcp.service running (11 MiB) |
containernetworking-plugins ships cni-dhcp.socket enabled; it serves the dhcp IPAM plugin, and allmyram's network uses host-local |
mask both units |
Lima's own guest agent unit is 0600 too (the same warning for
/etc/systemd/system/lima-guestagent.service); harmless.
4. Times (final image unless said; noisy, see Setup):
| Case | limactl start (s) |
start → warden job exited (s) |
|---|---|---|
| Warm (3; a fourth pulled alpine first: 15.5) | 8.73–10.10 | 9.39–10.47 |
Fresh instance (4; limactl create 0.35–0.59 s; alpine pulled each time) |
9.70–13.35 | 13.99–17.84 |
| Fresh instance, the build before (4) | 8.43–10.35 | 12.60–14.98 |
Same day, limactl start returned 5.8–8.8 s after the command for stock
Debian, 6.9–11.6 s for stock Garden Linux and 9.2–10.1 s for our flavor
(the idle runs above). In the guest (systemd-analyze, warm): firmware
0.5 s, loader 0.1 s, kernel 0.7 s, initrd 2.4 s, userspace 4.4 s. The
critical chain runs through systemd-networkd-wait-online (1.9 s), which
cloud-init-network.service waits on; #23 disabled it and saved 1.7 s.
Not tried here.
Packages: 298 (stock 298; #23 C 271). Added: containerd, containernetworking-plugins, runc, nftables, libnftables1, libjansson4, rsync. Gone: qemu-guest-agent, sshfs, fuse3, libfuse3-4, libnuma1, liburing2, sshguard. Stock already carries iptables, python3 (for cloud-init), auditd, rsyslog (disabled), sysstat, systemd-cron, rng-tools5 and nvme-cli.
Image: qcow2 809,041,920 bytes (stock 427,622,400); raw 2,216,689,664
bytes apparent, 822 MB allocated on the Mac; zstd -10 285,138,851 bytes
(#23 C 614,875,471). Partitions: USR 1 GiB ext4 (the builder sizes a
partition at 1.5 × its content), EFI 78 MiB, ROOT last, grown at first
boot to fill disk: (x-systemd.growfs).
Build (build.sh):
| Build | Total | Build VM | Clone | Builder | Copy out, unpack |
|---|---|---|---|---|---|
| Cold: new build VM, builder image pulled | 237 s | 99 s | 2 s | 114 s | 17 s |
| Build VM and builder image cached | 105 s | 0 s | 4 s | 80 s | 17 s |
The builder bootstraps from the release's apt suite on every build; nothing inside it is cached between builds. Byte reproducibility was not tested: the Go binaries embed the VCS revision, and each build here had a different feature or revision.
What we learned¶
- Garden Linux runs under Lima vz unchanged, and with our feature it
passes the gate's checks on the first build: boot, forced egress, a hard
kill answered by recreating the instance.
/usris read-only thegardenerway. - One kernel default decides everything. As shipped, the image idles
at 8.2 GB:
init_on_freezeroes all of RAM at boot, and vz keeps it. Withinit_on_free=0stock Garden Linux idles at 617–631 MB, ~45 MB under stock Debian (667–677). The guest also touches less it then frees (~25 MiB unseen against Debian's ~100). - Our flavor idles at 771–789 MB warm, 843 MB on a fresh instance's first boot: ~300 MB under #23 C, ~110 MB over stock Debian and ~80 MB over #18's Debian with the stack (~700 MB). The stack itself costs ~150 MB over stock Garden Linux, almost all of it containerd (92), the proxy (33) and the warden (18), much of it their binaries' file pages.
- Starts are not faster. Warm 8.7–10.1 s and a fresh instance to a
finished job 12.6–17.8 s, about #23 C's (7.7–7.8 s, 11.8–14.1 s) and
above #17's Debian. The guest's initrd (2.4 s) and
systemd-networkd-wait-online(1.9 s) are the visible costs. - Small and quick to build: 285 MB compressed (#23 C 615 MB), 298 packages, 4 min cold and under 2 min cached, with the package set fixed by the release's apt suite.
What it changes¶
- For Gavin before Tasks 11+: a Garden Linux VM at ~0.78 GB idle against
#23's Fedora at ~1.1 GB, with a pinned release, a pinned builder and a
read-only
/usr; it gives up SELinux (limaexcludes it). Debian with the stack (#18, ~0.7 GB) stays ~80 MB lower. - If Garden Linux goes forward, Tasks 11+ build from
spike/gardenlinux: theallmyramfeature,init_on_free=0,guestInstallPrefix: /var/usrlocal, masks rather than disables, and the unit substitutions done before the builder sees the files. Worth trying next, not measured here: disablingsystemd-networkd-wait-online, a host-only initramfs, and dropping more of stock's daemons (auditd, sysstat, systemd-cron, rng-tools5). - Any distribution's kernel needs
init_on_freechecked before its footprint means anything under vz.