Can't run snap in lxd container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I'm unable to run a snap inside a LXD container. I apt-installed squashfuse in the container and I was able to install it but it won't run, I get a remount error (the "unable to resolve host" error is irrelevant LXD noise):
root@cakeshop:~# sudo snap install --edge cakeshop
sudo: unable to resolve host cakeshop: Connection timed out
cakeshop (edge) master from 'cmars' installed
root@cakeshop:~# cakeshop
cannot remount /tmp/snap.
LXD host information:
ubuntu@ccube:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
ubuntu@ccube:~$ dpkg -l | grep lxd
ii lxd 2.0.11-
ii lxd-client 2.0.11-
LXD container information:
ubuntu@ccube:~$ lxc info cakeshop
Name: cakeshop
Remote: unix://
Architecture: x86_64
Created: 2018/01/27 18:41 UTC
Status: Running
Type: persistent
Profiles: default
Pid: 30623
Ips:
eth0: inet 192.168.88.20 vethSXYTL1
eth0: inet6 fe80::216:
lo: inet 127.0.0.1
lo: inet6 ::1
Resources:
Processes: 43
Disk usage:
root: 331.57MB
Memory usage:
Memory (current): 205.84MB
Memory (peak): 222.25MB
Network usage:
eth0:
Bytes received: 266.55MB
Bytes sent: 3.01MB
Packets received: 71500
Packets sent: 47066
lo:
Bytes received: 0B
Bytes sent: 0B
Packets received: 0
Packets sent: 0
root@cakeshop:~# dpkg -l | grep snapd
ii snapd 2.29.4.2 amd64 Daemon and tooling that enable snap packages
I can confirm this. Snaps are not working out of the box in Xenial or Bionic lxd containers. Same behavior with and without squashfuse installed.
$ lxc launch ubuntu:xenial 14T06:06: 04Z INFO Waiting for restart... rootfs_ YCmXs8/ var/lib/ snapd/lib/ vulkan as read-only: Permission denied
Creating the container
Container name is: divine-mink
Starting divine-mink
$ lxc exec divine-mink -- bash
root@divine-mink:~# snap install hello
Mount snap "core" (4650) .snap install hello
2018-06-
hello 2.10 from 'canonical' installed
root@divine-mink:~# snap install hello
snap "hello" is already installed, see "snap refresh --help"
root@divine-mink:~# hello
cannot remount /tmp/snap.