What this thread does
Do first: run sudo apt update on the affected Ubuntu 24.04 system.
When you need it
On Ubuntu 24.04, Codex can still report that it cannot create the required user namespace after bubblewrap is installed. The page directs you to copy and load the extra AppArmor profile for this case.
Steps
1. Update package information and install the profile packages:
sudo apt update
sudo apt install apparmor-profiles apparmor-utils
2. Copy the supplied profile into the active profile directory:
sudo install -m 0644 \
/usr/share/apparmor/extra-profiles/bwrap-userns-restrict \
/etc/apparmor.d/bwrap-userns-restrict
3. Load that profile into the kernel:
sudo apparmor_parser -r /etc/apparmor.d/bwrap-userns-restrict
Check it worked
The page says apparmor_parser -r loads the profile into the kernel without a reboot. It identifies the relevant symptom as Codex's startup warning about the missing user namespace; it provides no separate diagnostic command or success output for this repair.
Limits
This recipe is for Ubuntu 24.04 after bubblewrap installation. The page says Ubuntu 25.04's package already supplies the profile in /etc/apparmor.d/bwrap-userns-restrict. Codex chooses the first bwrap executable on PATH. For the Codex release, the page does not name a version.
Not for: repairing or refreshing a Windows sandbox; see codex-windows-sandbox-setup-refresh-update-fixes.
Sources
- Sandbox, Codex documentation, read 2026-11-24: "Copy and load the extra profile:"
Checked
2026-11-24; read <https://learn.chatgpt.com/docs/sandboxing.md#prerequisites>; no command was run.
Started from a post by @OpenAI, packaged by the editor. Original post