How can I run a Snappy / ubuntu-core image with LXD

Solution 1:

The LXD snappy package is not yet currently available as a general release image for LXC. What is however availble is a snap for testing LXD on snappy - stgraber has posted about this here:

https://plus.google.com/+St%C3%A9phaneGraber/posts/aX6vogzEQ1X

relevant bits:

A binary for amd64 can be downloaded at:
    https://dl.stgraber.org/lxd_0.11-git0_amd64.snap

Then installed with:
    snappy-remote --url=ssh://localhost:8022 install lxd_0.11-git0_amd64.snap

But this only helps you get started running other containers on snappy, not with loading snappy in LXD.

A good place to start the dialogue about what you would like to do would be the ubuntu mailing lists for LXD, or perhaps file a bug against the LXD project requesting a snappy image be published for consumption, where the team can then build an image, or request CPC build one.

Anything beyond that will be an exercise in manually building the LXC rootfs and containerizing it. YMMV

Solution 2:

This is now supported: lxc launch images:ubuntu-core/16/amd64 ubuntu-core

Credit @stgraber

https://stgraber.org/2017/01/31/ubuntu-core-in-lxd-containers/

Solution 3:

Due to kernel restrictions with regard to apparmor and unprivileged squashfs, both of which are required for Ubuntu Core's security model, it's not currently feasible to run snappy inside a LXD or LXC container.

It's something we'd definitely like to have soon but it seems unlikely that we'll achieve it for Ubuntu 16.04, nor is it on our roadmap for now.