Nesting LXD in LXD using a Debian stretch container


#1

Greetings

Reading this:
https://stgraber.org/2016/04/14/lxd-2-0-lxd-in-lxd-812/
So I decided to try things, except I’m running on a snap in Debian.
Looking at this:
https://insights.ubuntu.com/2017/02/22/lxd-on-debian-using-snapd/

so I tried things and got:

root@my-debian:~# snap install lxd
error: cannot perform the following tasks:

  • Mount snap “core” (3887) ([start snap-core-3887.mount] failed with exit status 1: Job for snap-core-3887.mount failed.
    See “systemctl status snap-core-3887.mount” and “journalctl -xe” for details.
    )
    root@my-debian:~# systemctl status snap-core-3887.mount
    ● snap-core-3887.mount - Mount unit for core
    Loaded: loaded (/etc/systemd/system/snap-core-3887.mount; enabled; vendor preset: enabled)
    Active: failed (Result: exit-code) since Sat 2018-02-10 18:09:39 UTC; 26s ago
    Where: /snap/core/3887
    What: /var/lib/snapd/snaps/core_3887.snap
    Process: 7261 ExecMount=/bin/mount /var/lib/snapd/snaps/core_3887.snap /snap/core/3887 -t squashfs (code=exited, status=32)

Feb 10 18:09:39 my-debian systemd[1]: snap-core-3887.mount: Failed to reset devices.list: Operation not permitted
Feb 10 18:09:39 my-debian systemd[1]: snap-core-3887.mount: Failed to set invocation ID on control group /system.slice/snap-core-3887.mount, ign
Feb 10 18:09:39 my-debian systemd[1]: Mounting Mount unit for core…
Feb 10 18:09:39 my-debian systemd[1]: snap-core-3887.mount: Mount process exited, code=exited status=32
Feb 10 18:09:39 my-debian systemd[1]: Failed to mount Mount unit for core.
Feb 10 18:09:39 my-debian systemd[1]: snap-core-3887.mount: Unit entered failed state.

Reading this it would seem to me that to run LXD on LXD one needs to be on Ubuntu unless there is some other trick to convincing the software to run.

Suggestions - - - - or is it wait until the porting crew has completed their work and one can run lxd natively on debian rather than needing to use snap (although it seems that snap is preferred by the lxd dev crew).


#2

It might be related to the fact that snaps currently run on Debian Linux kernels with the devmode confinement only.


#3

Just to make sure I’m understanding what you’re saying - - - nesting lxd inside lxd is only possible in ubuntu - - - yes?


#4

I made a conjecture. Probably not too helpful.

What you can do instead, is provide the necessary information according to https://insights.ubuntu.com/2017/02/22/lxd-on-debian-using-snapd/ in an easy-to-read way.
Specifically,

  1. What Debian version runs on the host. Which kernel version.
  2. The post mentions some requirements. Show that you indeed fulfill those requirements.

#5

OK so all the details according to the page which you mentioned. (You might note that this is also the document that I referenced as using for what I was trying to do.)

$ uname -r
4.9.0-5-amd64
You have new mail in /var/mail/memyself
memyself@debianserver:~$ apparmor --version
bash: apparmor: command not found

double checked and main contrib and non-free are all listed for the repositories in /sources/list
and I am using btrfs so I don’t think I need to worry about zfs libraries.

In my searches trying to understand why the nesting wouldn’t work it is clear that snap drags along apparmor so after you have snap install lxd it is impossible to comply with the non-apparmor provision inside the first level of container because you must have apparmor then to have snap. I tried to remove apparmor but then snap won’t work, trying to setup the second level of container so I have an impossible conundrum to resolve before I can install a second level of container.

Any idea of an eta for a native version of lxd for debian? (Hopefully that would eliminate this particular difficulty.) The real soon now has been posted for about 3 years at this point.


(Stéphane Graber) #6

I gave a long reply about this in another forum post, but the TL&DR is that you’re missing squashfuse in this case and I suspect that even with squashfuse installed, it wouldn’t actually work due to a normal Linux kernel not allowing fuse mounts from within containers.


#7

OK - - - so that verifies the experience.
Pity that it isn’t possible as it would make for a very interesting setup.
Would make for fantastic corporate flexibility too!

Thanks!!