Skip to content

Instantly share code, notes, and snippets.

@laanwj
Last active April 29, 2024 17:29
Show Gist options
  • Save laanwj/cddb2ec7d18e71066d21e5ee993fe971 to your computer and use it in GitHub Desktop.
Save laanwj/cddb2ec7d18e71066d21e5ee993fe971 to your computer and use it in GitHub Desktop.
Getting guix to work with apparmor on Ubuntu 24.04

The standard assumption up to now has been that applications that don't have a specific apparmor profile run in the "unconfined" profile, which essentially doesn't forbid anything. However, in 24.04, everything using unprivileged namespaces automatically ends up in the "unprivileged_userns" profile, which does add rules. Disabling this profile doesn't work, because that seems to block use of unprivileged namespaces completely.

What does work is to create a specifc apparmor profile for guix, that is really unconfined and allows user namespaces:

Create a file /etc/apparmor.d/guix:

abi <abi/4.0>,
include <tunables/global>

profile guix /usr/bin/guix flags=(unconfined) {
  userns,

  # Site-specific additions and overrides. See local/README for details.
  include if exists <local/guix>
}

Then do:

/etc/init.d/apparmor reload
aa-enforce guix

See:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment