normal users can't run snaps inside of LXD containers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snap-confine |
Fix Released
|
High
|
Jamie Strandboge | ||
snapd |
Fix Released
|
High
|
Tyler Hicks | ||
snap-confine (Ubuntu) |
Fix Released
|
High
|
Jamie Strandboge | ||
Xenial |
Fix Committed
|
High
|
Unassigned | ||
Yakkety |
Fix Committed
|
High
|
Unassigned | ||
snapd (Ubuntu) |
Fix Released
|
High
|
Tyler Hicks |
Bug Description
[Impact]
TBD
[Test Case]
Look below for a test case.
[Regression Potential]
TBD
[Other Info]
* snap-confine is technically an integral part of snapd which has an SRU exception and is allowed to introduce new features and take advantage of accelerated procedure. For more information see https:/
== # Pre-SRU bug description follows # ==
The kernel (4.8.0-19.21), apparmor (2.10.95-4ubuntu5), and lxd (2.4-0ubuntu1) needed for running snaps inside of LXD containers (bug #1611078) have all landed in Yakkety. We should be able to install squashfuse and snapd 2.16+16.10 (from yakkety-proposed) and then run snaps inside of unprivileged LXD containers.
I have verified that it works well for the root user inside of the container but there are some issues when a normal user attempts to run a snap command.
# Create yakkety container named "yakkety"
tyhicks@host:~$ lxc launch ubuntu-daily:devel yakkety
Creating yakkety
Starting yakkety
# Enter the container, enable yakkety-proposed, update, install the dependencies
tyhicks@host:~$ lxc exec yakkety bash
root@yakkety:~# echo "deb http://
yakkety-proposed restricted main multiverse universe" > \
/etc/apt/
root@yakkety:~# echo -e "Package: *\nPin: release a=yakkety-
Pin-Priority: 400" > /etc/apt/
root@yakkety:~# apt-get update && apt-get dist-upgrade -y
...
root@yakkety:~# apt-get install -y squashfuse snapd/yakkety-
...
# Rebooting the container should not be needed but is done for completeness
root@yakkety:~# reboot
tyhicks@host:~$ lxc exec yakkety bash
# Install the hello-world snap
root@yakkety:~# snap install hello-world
hello-world (stable) 6.3 from 'canonical' installed
# Snap commands work fine as root inside the container but not as a normal user
root@yakkety:~# /snap/bin/
SNAP_USER_
...
root@yakkety:~# su - ubuntu -c '/snap/
internal error, please report: running "hello-world.env" failed: open /snap/hello-
# The normal user can't access /snap/hello-
# dentry
root@yakkety:~# ls -al /snap/hello-world
total 8
drwxr-xr-x 3 root root 4096 Oct 5 21:09 .
drwxr-xr-x 5 root root 4096 Oct 5 21:09 ..
drwxrwxr-x 4 root root 0 Jul 11 21:20 27
lrwxrwxrwx 1 root root 2 Oct 5 21:09 current -> 27
root@yakkety:~# su - ubuntu -c 'ls -al /snap/hello-world'
ls: cannot access '/snap/
total 8
drwxr-xr-x 3 root root 4096 Oct 5 21:09 .
drwxr-xr-x 5 root root 4096 Oct 5 21:09 ..
d????????? ? ? ? ? ? 27
lrwxrwxrwx 1 root root 2 Oct 5 21:09 current -> 27
Changed in snappy: | |
status: | New → Triaged |
description: | updated |
Changed in snap-confine (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
status: | Triaged → In Progress |
Changed in snappy: | |
status: | Triaged → In Progress |
assignee: | nobody → Tyler Hicks (tyhicks) |
Changed in snapd (Ubuntu): | |
assignee: | nobody → Tyler Hicks (tyhicks) |
status: | Triaged → In Progress |
Changed in snapd (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in snap-confine: | |
milestone: | none → 1.0.44 |
Changed in snap-confine: | |
status: | Fix Committed → Fix Released |
description: | updated |
Changed in snap-confine (Ubuntu Xenial): | |
importance: | Undecided → High |
Changed in snap-confine (Ubuntu Yakkety): | |
importance: | Undecided → High |
Here's the contents of the kernel ring buffer while running the following commands:
tyhicks@host:~$ lxc start yakkety bin/hello- world.env' world/27/ meta/snap. yaml: permission denied
tyhicks@host:~$ lxc exec yakkety bash
root@yakkety:~# su - ubuntu -c '/snap/
internal error, please report: running "hello-world.env" failed: open /snap/hello-
Note that all of the output occurs while `lxc start yakkety` is running and none of the log entries stem from the command where hello-world.env is invoked.