Can’t install snap in LXC container

If you are encountering an error while installing the Proxmox snapd package.

# 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.

Solution to this error

You can follow the steps below to solve this problem.

sudo apt update && sudo apt dist-upgrade
sudo apt install squashfuse fuse
sudo apt install snapd
sudo mkdir /lib/modules

From the Proxmox host, modify the configuration file located at /etc/pve/lxc/<CTID>.conf and include the following:

# 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

After making the necessary changes to the configuration file, proceed to shut down and then restart your container.

When attempting to install your desired snap, you may encounter the following error:

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

Try installing the same snap again, and this time it should work without any issues.

Leave a Comment