udev interface fails in privileged containers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned | ||
snapd |
Confirmed
|
Medium
|
Unassigned | ||
lxd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I think this is possibly a known issue since there's evidence of a workaround in e.g. https:/
Installing snaps in a privileged LXD container fails. Here's a test script:
$ lxc launch -c security.
$ lxc exec snap-test apt update
$ lxc exec snap-test apt install squashfuse
$ lxc exec snap-test snap install hello-world
2017-
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/
Changed in snapd: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in snapd: | |
status: | Expired → Confirmed |
On IRC, Stéphane suggested making the container "even more privileged" as a cleaner workaround, by adding the following to raw.lxc:
lxc.mount.auto= auto=proc: rw sys:rw
lxc.mount.
(I also had to fiddle with my restrictive policy-rc.d script to allow udev to start.)
Perhaps documenting that somewhere reasonably findable would be good enough?