Snaps are broken in bionic LXD container

I’m running Bionic for the host, but I’ve also seen this in Travis (which is Trusty), using the lxd snap from 3.0/stable. Let me show you:

$ lxc launch ubuntu:bionic -e
Creating the container
Container name is: organic-penguin
Starting organic-penguin

$ lxc exec organic-penguin -- snap install hello
2018-09-12T20:59:10Z INFO Waiting for restart...
hello 2.10 from 'canonical' installed

$ lxc exec organic-penguin -- hello
cannot perform operation: mount --rbind /lib/modules /tmp/snap.rootfs_8u8wnr//lib/modules: No such file or directory

All snaps fail in this way. Do we still not have LXD tests in snapd? There’s spread coverage of so many distros, would like to see LXD xenial and bionic in there.

Note that making /lib/modules in the container seems to work around this issue:

$ lxc exec organic-penguin -- mkdir /lib/modules
$ lxc exec organic-penguin -- hello
Hello, world!
1 Like

This is because /lib/modules was mandatory. It is optional in master now. The next release will not have this requirement.

1 Like

Confirmed, thank you. Using the edge channel of the core snap in the container causes things to work again.