Installing snap in lxc container

Hello turris masters,

is there any way to install snap packages inside lxc container on Turris Omnia?
I tried to run ubuntu in lxc container and installed snapd there, but installing any snap gives me this error:

sudo snap install nextcloud
error: system does not fully support snapd: cannot mount squashfs image using “squashfs”: mount:
/tmp/sanity-mountpoint-549069762: mount failed: Operation not permitted.

After some googling it feels like I have to enable nesting of containers but I can’t figure out how to do it in turris.

PS: I’m aware nextcloud can be installed directly in turris

Thanks for any hints.

I got the same error on Ubuntu Eoan.

# snap --version
snap    2.42.1+19.10
snapd   2.42.1+19.10
series  16
ubuntu  19.10
kernel  4.14.162

# sudo snap install powershell --classic
error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
       /tmp/sanity-mountpoint-072786794: mount failed: Operation not permitted.

Perhaps this has something to do with the processor’s architecture:

# uname -m
armv7l

Relevant:

The host would have to support squashfs through its kernel - is kmod-fs-squashfs installed?

I’d first “check somewhere” how exactly is running snapd inside a container even a supported thing – on any Linux, not only Turris. IIRC nesting of containers doesn’t “just work” yet, at least in default kernels. (To me personally the nesting concept itself seems a bit perverse, but I’m digressing.)

# apt list --installed | grep kmod

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

kmod/eoan-updates,now 26-1ubuntu1.1 armhf [installed]
libkmod2/eoan-updates,now 26-1ubuntu1.1 armhf [installed]

Do either of these contain kmod-fs-squashfs?

This is not the host but the guest.

1 Like

You mean that the TurrisOS would need to have this package installed?

Yes. The guest leverages the host’s kernel and if the host’s kernel does not support squashfs neither can the guest.

1 Like

For my purposes (to install PS), do I need all of thees?

just the kernel module (kmod). If the permission issue is still present you may have to wait for lxc version 4.x to arrive https://github.com/openwrt/packages/commit/9f43594e3a28deeea18cfa40acd0b1388e64f600

There are a lot of kmod packages installed, including libkmod 20-1.1 which is the kernel, right?

I’m still getting the error, so I guess I’ll try again when lxc is upgraded.

Thanks for the help.

It’s good that somebody updated LXC in OpenWrt, but this is just in OpenWrt master and it will be available in the HBD branch soon and I don’t think that it is a good idea to recommend HBD to anyone without a big warning.

There is a difference between recommending HBD, which I did not any way, and