← Back to issue list

udev interface fails in privileged containers

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1712808
Type
issue
State
open
Author
~saviq
Labels
verification-done-noble verification-done-plucky verification-done-questing verification-needed verification-needed-jammy
Created
Updated
Closed
—

Current evaluation

Long-standing bug: snap installs in privileged LXD/LXC containers fail with "cannot reload udev rules". Fixed upstream by snapd PR 14930 and SRU'd as snapd 2.68.5 to jammy/noble/plucky; jammy verification still pending.

Suggested action: close resolved

Reason: The ~janitor comments state the bug was fixed in snapd 2.68.5+ubuntu25.04.2, 2.68.5+ubuntu24.04.1 and 2.68.5+ubuntu22.04.1 (LP #2098137 / snapd PR 14930, which disables udev support in containers), and the SRU was released to -updates per ~tjaalton. Verification of noble/plucky/questing is recorded in the issue, and ~ahasenack confirmed a separate, unrelated jammy container seeding problem; the remaining verification-needed-jammy tag is a process leftover rather than an open defect in snapcraft.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 23 Complexity: 40 Confidence: 82 Actionability: 70

Issue body

[SRU] 2.68.5: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/2098137 [ Impact ] Error containing "cannot reload udev rules: exit status X" when doing an actions e.g. installation of hello-world on a privileged container. [ Test Plan ] 1. Produce error with snapd 2.67.1+25.04 deb (inside the lxd container) snap install lxd --channel=5.21/stable lxd init (use defaults) lxc launch -c security.privileged=true ubuntu:24.04 test lxc exec test -- bash snap install hello-world expect to see error ``` error: cannot perform the following tasks: - Setup snap "snapd" (24792) security profiles (cannot reload udev rules: exit status 1 udev output: Failed to send reload request: No such file or directory ) ``` 2. Change to snapd 2.68.5 deb (inside the lxd container) lxc exec test -- bash Moify /etc/apt/sources.list.d/ubuntu.sources: add <release>-proposed sudo apt update apt install snapd=2.68.5+ubuntu<release>.<iteration> e.g. apt install snapd=2.68.5+ubuntu25.04.2 snap install hello-world do not expect to see the error anymore ``` snap install hello-world 2025-08-01T18:49:01Z INFO Waiting for automatic snapd restart... hello-world 6.4 from Canonical✓ installed ``` Repeat for all targeted Ubuntu releases. ---original--- I think this is possibly a known issue since there's evidence of a workaround in e.g. https://stgraber.org/2017/01/13/kubernetes-inside-lxd/, but I couldn't find any proper discussion of it. Installing snaps in a privileged LXD container fails. Here's a test script:   $ lxc launch -c security.privileged=true ubuntu:16.04 snap-test   $ lxc exec snap-test apt update   $ lxc exec snap-test apt install squashfuse   $ lxc exec snap-test snap install hello-world   2017-08-24T12:03:59Z INFO cannot auto connect core:core-support-plug to core:core-support: (slot auto-connection), existing connection state "core:core-support-plug core:core-support" in the way   error: cannot perform the following tasks:   - Setup snap "core" (2462) security profiles (cannot setup udev for snap "core": cannot reload udev rules: exit status 2   udev output:   )   - Setup snap "core" (2462) security profiles (cannot reload udev rules: exit status 2   udev output:   ) This is because /sys is mounted read-only in privileged containers (presumably to avoid causing havoc to the host) and so the systemd-udevd service isn't started. The prevailing recommendation seems to be to work around it by making /usr/local/bin/udevadm be a symlink to /bin/true, but this looks like a hack rather than a proper fix.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 23
Complexity: 40
Confidence: 82
Actionability: 70
close resolved Long-standing bug: snap installs in privileged LXD/LXC containers fail with "cannot reload udev rules". Fixed upstream by snapd PR 14930 and SRU'd as snapd 2.68.5 to jammy/noble/plucky; jammy verification still pending.
stealth/space-bunny-alpha
Impact: 65
Quick Win: 37
Complexity: 30
Confidence: 88
Actionability: 82
close resolved LP #1712808: snapd udev reload fails in privileged LXD containers; fixed upstream in snapd 2.68.5 (SRU'd to jammy/noble/plucky), but Launchpad bug is still open with stale verification-needed-jammy.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 39
Complexity: 30
Confidence: 85
Actionability: 80
close resolved snapd udev reload fails in privileged LXD containers; fixed in snapd 2.68.5. Filed against snapcraft but affects snapd.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 30
Staleness: 55
Complexity: 40
Confidence: 75
Support Request: 10
keep open snapd fails to reload udev rules when installing snaps in privileged LXD containers (no udevd running). Fixed in snapd 2.68.5; verification done for noble/plucky/questing, jammy verification still pending.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 20
Confidence: 75
Support Request: 5
needs triage SRU fix for snapd udev reload failure in privileged LXD containers. Verified for newer releases, but jammy verification remains pending after ~9 years.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 25
Confidence: 90
Support Request: 5
close stale Bug in snapd where udev rule reloading fails in privileged LXD containers due to read-only /sys. Marked verification-done for multiple Ubuntu releases, indicating a fix was implemented and verified in snapd 2.68.5. Issue remains open but resolved.
qwen3.6-35b-a3b-mtp-q6
Staleness: 35
Complexity: 20
Confidence: 85
Support Request: 5
needs triage SRU for snapd 2.68.5 fixing udev reload failures when installing snaps in privileged LXD containers. Verification labels exist for multiple releases, but no maintainer comments or assignee visible.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapd#14930 (confidence 90%)

    ~zyga's upstream PR disabling udev support in containers is cited in the comments as the actual fix, rolled out in snapd 2.68.5.

  • Related To: snapd#2098137 (confidence 85%)

    The snapd SRU tracking bug linked at the top of the body, referenced in the janitor changelog entries for all three releases.

Related issues

Issue Project State Summary Similarity
#53 buildd: install udev dependency for snapd (CRAFT-288) craft-providers merged Merged PR #53 added the udev package required by snapd in LXD buildd images; integrated by merge commit 6f80f76.
71%