Fixing AppArmor Unprivileged User Namespace Restriction on Ubuntu 24.04

How to fix the 'User namespaces are not usable' error caused by AppArmor restrictions on Ubuntu 24.04
May 27, 2026

Fixing AppArmor Unprivileged User Namespace Restriction on Ubuntu 24.04

AppArmor is a Linux kernel security module (LSM) that restricts the resources a process can access based on per-program profiles.
Ubuntu 24.04 Noble Numbat onwards, AppArmor has tightened its policy to block unprivileged user namespaces by default.
Yocto/BitBake internally uses pseudo (a fakeroot replacement) and user namespaces for build isolation.
This error commonly occurs when adding layers such as meta-security or meta-virtualization, or when building container-related recipes.
The following error occurs when running BitBake.
Error: User namespaces are not usable
Doc

ERROR: User namespaces are not usable by BitBake, possibly due to AppArmor. See https://discourse.ubuntu.com/t/ubuntu-24-04-lts-noble-numbat-release-notes/39890 for more information.

Apply Immediately (current session)

Use this when immediate application is needed; note that the setting resets on reboot.
Disable AppArmor user namespace restriction (temporary)
sh

Persist Across Reboots

Apply permanently to persist the setting across reboots.
Persist the setting across reboots
sh
Jooojub
System S/W engineer
Explore Tags
Series
    Recent Post
    © 2026. jooojub. All right reserved.