diff --git a/images/README.md b/images/README.md new file mode 100644 index 0000000..63e4f85 --- /dev/null +++ b/images/README.md @@ -0,0 +1,60 @@ +# Images + +mkosi image definitions for SEV-SNP host and guest environments. Each subdirectory contains a `mkosi.conf` for one image. + +## Build + +```bash +make list # show available images +make host-fedora-41 # build a specific image +make all # build every image +make clean-host-fedora-41 # clean a specific image +make clean # clean every image +make status # show built images and their artifacts +``` + +## Naming + +``` +{role}-{distro}-{release} +``` + +- **role**: `host` (bare-metal SEV hypervisor) or `guest` (SEV guest UKI/EFI) +- **distro**: `fedora`, `ubuntu`, `centos`, `debian`, `rocky` +- **release**: distro version number or codename + +## Ubuntu: AppArmor + mkosi + +Ubuntu restricts unprivileged user namespaces via AppArmor, which breaks mkosi. See [systemd/mkosi#3265](https://github.com/systemd/mkosi/issues/3265). + +**Quick fix** -- disable the restriction system-wide (**security impact**: this weakens AppArmor protections for all userspace; `sysctl -w` changes are temporary until reboot unless persisted in `/etc/sysctl.d`): + +```bash +sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 +sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 +``` + +To revert: + +```bash +sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=1 +sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=1 +``` + +**Per-binary fix:** Create `/etc/apparmor.d/mkosi` (adjust path if needed): + +``` +abi , +include + +profile mkosi /usr/bin/mkosi flags=(unconfined) { + userns, + include if exists +} +``` + +Then reload: + +```bash +sudo systemctl reload apparmor +```