How a Conflicting AppArmor Profile Broke My Ubuntu 26.04 Login

Following an upgrade from Ubuntu 24.04 to Ubuntu 26.04.1, the system booted successfully but failed to display a usable graphical login screen.

Instead of the normal GNOME login interface, GDM displayed a mostly blank gray screen with only the clock visible. The username/password interface never appeared.

The system itself was operational. Switching to a virtual terminal using Ctrl+Alt+F3 worked, allowing troubleshooting from the command line.

The root cause was a conflict between two AppArmor profiles targeting the same executable:

  • /etc/apparmor.d/bwrap-userns-restrict
  • /etc/apparmor.d/claude-desktop-bwrap

Both profiles attempted to attach to /usr/bin/bwrap, the Bubblewrap sandboxing utility.

This resulted in AppArmor errors and prevented Bubblewrap from successfully creating a user namespace. GNOME Shell also reported a JavaScript exception while constructing the GDM login dialog.

Removing the conflicting Claude Desktop AppArmor profile resolved the issue without requiring AppArmor's security restrictions to be disabled.

Symptoms

Immediately after rebooting into Ubuntu 26.04.1:

  • The graphical login screen displayed a gray background.
  • The clock was visible.
  • The normal login interface was missing.
  • The system did not appear to be completely frozen.
  • Ctrl+Alt+F3 successfully switched to a working TTY.

The last point was important: Linux had booted, and the problem was specifically associated with the graphical login environment.

Because this machine had previously experienced AMDGPU-related freezes, graphics drivers were an initial concern.

However, the eventual diagnosis showed that the login failure was caused by sandboxing and AppArmor policy conflicts rather than a confirmed graphics-driver problem.

Key diagnostic evidence

GNOME Shell error

The GDM-related logs contained the following JavaScript exception:

JS ERROR: Error: Argument child may not be null
resource:///org/gnome/shell/gdm/loginDialog.js

This indicated that GNOME Shell encountered a problem while constructing the login dialog.

The error alone did not identify the underlying cause.

AppArmor errors

Additional logs revealed AppArmor errors involving Bubblewrap.

One important message was:

apparmor="AUDIT"
operation="exec"
info="conflicting profile attachments"
name="/usr/bin/bwrap"

Another showed a denied operation involving user namespace configuration:

apparmor="DENIED"
profile="unprivileged_userns"
name="proc/.../uid_map"

These messages shifted the investigation away from GNOME themes and graphics drivers toward AppArmor and Linux user namespaces.

Bubblewrap failure

A direct Bubblewrap test failed with:

bwrap: setting up uid map: Permission denied

This provided a reproducible failure outside the GNOME login interface.

The command used for testing was:

bwrap \
  --ro-bind /usr /usr \
  --ro-bind /lib /lib \
  --ro-bind /lib64 /lib64 \
  --proc /proc \
  --dev /dev \
  --unshare-user \
  --unshare-pid \
  -- /usr/bin/true

A successful execution of this command produces no output and exits with status zero.

Root cause

Two AppArmor profiles were configured for the same Bubblewrap executable.

Ubuntu's Bubblewrap profile

File:

/etc/apparmor.d/bwrap-userns-restrict

This was supplied by Ubuntu's apparmor package.

It defined a profile attached to:

/usr/bin/bwrap

Claude Desktop's Bubblewrap profile

File:

/etc/apparmor.d/claude-desktop-bwrap

This profile also targeted:

/usr/bin/bwrap

Its profile declaration included:

profile claude-desktop-bwrap /usr/bin/bwrap flags=(unconfined)

The two profiles had conflicting attachment rules.

AppArmor reported this explicitly as:

conflicting profile attachments

The conflict interfered with Bubblewrap's ability to establish a user namespace under Ubuntu's AppArmor restrictions.

The resulting sandbox failure coincided with GNOME Shell's inability to construct the GDM login interface correctly.

Important distinction: The logs established the AppArmor conflict and the Bubblewrap failure. The fact that removing the conflict restored GDM strongly supports the causal connection, although we did not trace every internal GNOME operation between Bubblewrap and the login dialog exception.

Confirming the AppArmor connection

During troubleshooting, the following kernel setting was temporarily changed:

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

This disabled AppArmor's additional restrictions on unprivileged user namespaces.

With the restriction disabled, the graphical login worked.

That was a major diagnostic clue: it suggested the problem was related to namespace restrictions rather than the graphics stack.

However, leaving this setting disabled was not considered an acceptable permanent solution because it would weaken a system-wide security restriction.

The goal became fixing the conflicting profiles while keeping the restriction enabled.

The fix

The conflicting Claude Desktop Bubblewrap profile was moved out of AppArmor's configuration directory:

sudo mv \
  /etc/apparmor.d/claude-desktop-bwrap \
  /root/claude-desktop-bwrap.backup

The already-loaded profile was then unloaded:

sudo apparmor_parser -R \
  /root/claude-desktop-bwrap.backup

This distinction matters.

Moving an AppArmor profile file does not necessarily remove a profile already loaded into the kernel. Unloading it ensures the active policy is updated.

The system-wide namespace restriction was restored:

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=1

The Bubblewrap test was repeated and completed successfully without errors.

After restarting GDM, the normal graphical login interface returned.

The issue was resolved with AppArmor's namespace restrictions enabled.

Where did the conflicting profile come from?

Two Claude Desktop packages were present during the investigation:

claude-desktop
claude-desktop-unofficial

The installed versions were:

claude-desktop             5.11492.5
claude-desktop-unofficial  1.19367.0-3.2.1

The current claude-desktop package's post-installation script created a different AppArmor profile:

/etc/apparmor.d/claude-desktop

That profile targeted the Claude Desktop application itself rather than /usr/bin/bwrap.

Searching the package-maintainer scripts for references to the conflicting profile revealed:

/var/lib/dpkg/info/claude-desktop-unofficial.postrm

This strongly suggested that the unofficial Claude Desktop package was responsible for the conflicting Bubblewrap profile.

However, the installation script that originally created the profile was not conclusively identified during the investigation.

The unofficial package was subsequently uninstalled and its remaining package configuration purged.

The key takeaway is that the problem was not simply that Claude Desktop was installed, but that an additional AppArmor profile targeting the system Bubblewrap executable conflicted with Ubuntu's own profile.

Troubleshooting approaches that did not resolve the issue

Several other approaches were tested before identifying the AppArmor conflict.

Changing the GDM theme

The login theme was temporarily switched from Ubuntu's Yaru theme to the upstream GNOME theme.

This did not resolve the failure.

The original Yaru theme was subsequently restored.

Disabling the GDM user list

The GDM setting:

org.gnome.login-screen disable-user-list

was temporarily enabled.

This did not fix the login screen.

The setting was later restored to false.

Because the machine had a history of AMDGPU issues, graphics problems were a plausible initial explanation.

However, the decisive evidence came from AppArmor and Bubblewrap rather than GPU errors.

No graphics-driver change was required to resolve this particular incident.

Commands useful for diagnosing similar failures

If GDM displays an incomplete login screen after an Ubuntu upgrade, the following commands may help identify a similar problem.

Inspect GDM logs:

journalctl -b -u gdm3 --no-pager

Search for AppArmor denials and conflicting profiles:

sudo journalctl -k -b --no-pager \
  | grep -Ei 'apparmor|DENIED|conflicting profile'

Find AppArmor configurations referencing Bubblewrap:

sudo grep -Rn '/usr/bin/bwrap' /etc/apparmor.d/

Inspect loaded AppArmor profiles:

sudo aa-status

Check the namespace restriction setting:

sysctl kernel.apparmor_restrict_unprivileged_userns

Test Bubblewrap directly:

bwrap \
  --ro-bind /usr /usr \
  --ro-bind /lib /lib \
  --ro-bind /lib64 /lib64 \
  --proc /proc \
  --dev /dev \
  --unshare-user \
  --unshare-pid \
  -- /usr/bin/true

These are diagnostic commands, not a universal fix. A blank GDM screen can have many causes, and AppArmor profiles should not be removed without understanding their purpose.

Lessons learned

A graphical failure is not necessarily a graphics problem

A blank or incomplete login screen naturally suggests a GNOME, Wayland, GDM, or graphics-driver issue.

In this case, the underlying problem was a sandboxing policy conflict.

A reproducible command-line failure is valuable

The direct Bubblewrap test was particularly useful because it reproduced the namespace failure independently of GDM.

That helped narrow the investigation.

Third-party packages can modify system-wide security behavior

An application-specific package can install an AppArmor profile that affects a shared system executable.

When two packages attempt to control the same executable through conflicting profiles, the consequences can extend beyond either application.

Temporary security changes should remain temporary

Disabling AppArmor's unprivileged user namespace restriction helped identify the problem.

But the correct resolution was removing the conflicting profile, not permanently weakening the restriction.

Distribution upgrades expose existing configuration conflicts

The conflicting profile may have existed before the Ubuntu upgrade without causing an obvious failure.

The upgrade changed the environment in which those profiles operated, exposing the conflict.

The exact change that made the conflict visible was not established during this investigation.

Conclusion

The Ubuntu 26.04.1 upgrade itself completed successfully, but GDM could not present the normal login interface because AppArmor reported conflicting profiles attached to /usr/bin/bwrap.

The resolution was to remove the conflicting third-party Bubblewrap profile, unload it from AppArmor, and retain Ubuntu's normal user namespace restrictions.

The system returned to a working graphical login without replacing graphics drivers, reinstalling GNOME, or disabling AppArmor security protections.