mirror of
https://github.com/floci-io/floci.git
synced 2026-12-05 11:07:59 -05:00
A systemd guest shares the Docker host's kernel but ships none of its modules, so `modprobe br_netfilter` (Kubernetes node setup, e.g. Kubernetes The Hard Way lab 9) fails with "Module not found in directory /lib/modules/<kver>" even when the module is built in. kind binds the host's tree the same way. Docker creates a missing bind source as an empty directory, so hosts without /lib/modules still launch. Privileged systemd guests can now load any module in that tree into the shared host (or Docker Desktop / OrbStack VM) kernel, so docs/services/ec2.md carries a warning saying so. test(ec2): prove a systemd guest gets /lib/modules read-only on a real daemon Ec2SystemdGuestDockerIntegrationTest launches through the real Ec2ContainerManager container spec against Docker, with an Alpine image standing in for a systemd cloud image (its busybox /sbin/init stays up as PID 1), and checks the mount both from the daemon's inspect and from the guest's /proc/mounts. It is skipped when Docker is unavailable. docs/services/ec2.md now says that on Docker Desktop or OrbStack the tree is the VM's and may not match its running kernel, and states exactly when an instance runs privileged: only with security-group enforcement off. With enforcement on, the guest joins the protected namespace unprivileged, and a namespace that cannot be created fails the launch. docs(ec2): say the read-only modules mount does not bind a privileged guest; keep test cleanup from masking failures The read-only bind keeps an unprivileged guest from changing the tree, but a privileged guest can remount it read-write, so the first paragraph no longer claims the guest cannot load a module the host kernel lacks. The systemd guest test now logs a failed container removal instead of throwing it over the assertion error it is reporting. fix(ec2): bind only the running kernel's /lib/modules dir into systemd guests; tear down the integration test via terminate() test(ec2): pin that the guest's /lib/modules outside the bound kernel dir stays writable; document missing-dir and linux-modules caveats