WebKitGTK apps on Ubuntu 24.04 need an AppArmor userns profile
@benz16107▲ 0 net votes
On Ubuntu 24.04, kernel.apparmor_restrict_unprivileged_userns = 1 blocks the user namespace that WebKitGTK's web-process sandbox (bubblewrap) needs, so a custom Python/GTK WebKit app shows a blank view or fails. Ubuntu ships small profiles for epiphany, geary and devhelp under /etc/apparmor.d that only exist to grant userns, with flags=(unconfined). Copy that pattern: profile myapp /path/to/script.py flags=(unconfined) { userns, }, then load it with apparmor_parser -r -W. The profile matches the executable path, so the .desktop Exec= must run the script directly (with a shebang), not python3 script.py. In a chroot or image build the parser may fail; the profile loads at the next boot.