[SOLVED] Can't install snap in LXC container

ndroftheline

Member
Jun 17, 2017
33
10
13
33
Hey all,

I'm on $pveversion
pve-manager/6.1-8/806edfe1 (running kernel: 5.3.18-3-pve)

I found a couple useful-seeming posts on using snaps in LXC containers (specifically https://forum.proxmox.com/threads/ubuntu-snaps-inside-lxc-container-on-proxmox.36463/post-230060 ) and applied those requirements:

Code:
~$ cat /etc/pve/lxc/142.conf
arch: amd64
cores: 1
features: mount=fuse,nesting=1
hostname: wekan1
memory: 1512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=42:23:70:4C:96:A9,ip=dhcp,type=veth
ostype: ubuntu
rootfs: mkx-mass:subvol-142-disk-0,size=8G
swap: 1512
unprivileged: 1

In the container, squashfuse is already the newest version (0.1.100-0ubuntu2). This is in a Ubuntu 18.04 template that's been updated to latest.

# snap install hello-world
error: system does not fully support snapd: cannot mount squashfs image using
"squashfs": mount: /tmp/sanity-mountpoint-612465744: mount failed: Operation
not permitted.

What did I miss?

Also, as an aside, this post looked useful to me (since I'm actually trying to run the wekan snap in this container anyway ultimately): https://github.com/wekan/wekan-snap/issues/30

But that's using OpenVZ which I realize now is not relevant to proxmox anymore, not sure if that context helps at all.

Thanks for any input!
 

ndroftheline

Member
Jun 17, 2017
33
10
13
33
Hm, think I fixed it. There's a tickbox in the container features that just says FUSE, which adds fuse=1 to the features: line in the $vmid.conf file.

Now i have:

Code:
~$ cat /etc/pve/nodes/mkx/lxc/142.conf
arch: amd64
cores: 1
features: fuse=1,mount=fuse,nesting=1
hostname: wekan1
memory: 1512
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=42:23:70:4C:96:A9,ip=dhcp,type=veth
ostype: ubuntu
rootfs: mkx-mass:subvol-142-disk-0,size=8G
swap: 1512
unprivileged: 1

and i can install the hello-world snap OK.
 
  • Like
Reactions: gomu

ndroftheline

Member
Jun 17, 2017
33
10
13
33
yes, this is working, don't actaully need the mount=fuse feature manually added just ticking "FUSE" and "Nesting" works fine. I do get this error on the first attempt to install any snap:

Code:
error: cannot perform the following tasks:
- Setup snap "core" (8935) security profiles (cannot setup udev for snap "core": cannot reload udev rules: exit status 2
udev output:
)
- Setup snap "core" (8935) security profiles (cannot reload udev rules: exit status 2
udev output:
)

but then re-running the snap install command a second time works, and the snaps appear to be working correctly in my (very limited) testing.
 
  • Like
Reactions: Lionhead

ziddey

Member
Oct 25, 2016
3
1
23
41
Did this a while back with success for a few snaps. However, now I'm needing to install the chromium snap (to satisfy a dependency) and am running into the same error above. Rerunning doesn't help. Any ideas?
 
Aug 15, 2018
34
2
13
45
núcleo de instalação instantânea; núcleo de atualização instantânea
erro: o sistema não é totalmente compatível com snapd: não é possível montar a imagem squashfs usando "squashfs": mount:
/ tmp / sanity-mountpoint-884756066: montagem falhou: operação não permitida.
erro: o sistema não é totalmente compatível com snapd: não é possível montar a imagem squashfs usando "squashfs": mount:
/ tmp / sanity-mountpoint-884756066: montagem falhou: operação não permitida.
 

johnha

Member
Jan 1, 2018
20
5
8
Code:
error: cannot perform the following tasks:
- Setup snap "core" (8935) security profiles (cannot setup udev for snap "core": cannot reload udev rules: exit status 2
udev output:
)
- Setup snap "core" (8935) security profiles (cannot reload udev rules: exit status 2
udev output:
)

but then re-running the snap install command a second time works, and the snaps appear to be working correctly in my (very limited) testing.

Thanks for this thread. I can confirm that `snap install hello-world` gives me a similar error, but running it a second time works.

My error is:
Code:
error: cannot perform the following tasks:
- Setup snap "core" (10823) security profiles (cannot reload udev rules: exit status 1
udev output:
Failed to send reload request: No such file or directory
)
 

iGadget

New Member
Apr 9, 2020
18
2
3
41
As per https://github.com/lxc/lxc/issues/1854 and specifically https://github.com/lxc/lxc/issues/1854#issuecomment-606241047 , I did the following in the container:
Code:
sudo apt update && sudo apt dist-upgrade
sudo apt install squashfuse fuse
sudo apt install snapd
sudo mkdir /lib/modules

From the Proxmox host, edit the config file at /etc/pve/lxc/<CTID>.conf and add:
Code:
# Mounting fuse (for snap squashfs)
lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file,optional

# Mount cgroup in rw to get snaps working
lxc.mount.auto=cgroup:rw
Then shutdown and start your container.

Install your desired snap, get the following error:
Code:
error: cannot perform the following tasks:
- Setup snap "snapd" (11107) security profiles (cannot reload udev rules: exit status 1
udev output:
Failed to send reload request: No such file or directory
Install the same snap again, then it works.
 

timonoj

Member
Apr 19, 2017
13
0
6
40
Hi! I'm having the same issue as other people mentioned:

Code:
sudo snap install chromium
error: cannot perform the following tasks:
- Setup snap "chromium" (1536) security profiles (cannot setup udev for snap "chromium": cannot reload udev rules: exit status 1
udev output:
Failed to send reload request: No such file or directory
)
- Setup snap "chromium" (1536) security profiles (cannot setup udev for snap "chromium": cannot reload udev rules: exit status 1
udev output:
Failed to send reload request: No such file or directory
)
- Setup snap "chromium" (1536) security profiles (cannot setup udev for snap "chromium": cannot reload udev rules: exit status 1
udev output:
Failed to send reload request: No such file or directory
)

However, attempting to run the command again gets no different results. It just keeps failing the same way. Installing other snaps seems to work...Installing core didn't throw any errors. Any ideas? This is a non-privileged container.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!