Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions images/README.md
Original file line number Diff line number Diff line change
@@ -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 <abi/4.0>,
include <tunables/global>

profile mkosi /usr/bin/mkosi flags=(unconfined) {
userns,
include if exists <local/mkosi>
}
```

Then reload:

```bash
sudo systemctl reload apparmor
```