Using ZFS commands inside LXC container

veltsob

New Member
Oct 24, 2025
1
0
1
Hi,

I am trying to set up a debian 13 LXC container on Proxmox 9.0.11 from which I can manage ZFS pools. I managed to bind the ZFS storage to the container, however, now I am struggling to get ZFS commands to work inside the container. When I try to use a ZFS command, I get
Code:
zpool status
Failed to initialize the libzfs library.

What I have done so far is that I added the proxmox repos inside the container, so the ZFS packages inside the container are the same version as on the proxmox host, as the packages from the debian repos were a few versions behind. Furthermore, I added this to the LXC config file:
Code:
lxc.cgroup.devices.allow: c 10:249 rwm
lxc.mount.entry: /dev/zfs dev/zfs none bind,create=file 0 0
lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0
lxc.mount.entry: /sys/class sys/class none bind,rw,create=dir 0 0
lxc.mount.entry: /sys/devices sys/devices none bind,rw,create=dir 0 0
lxc.apparmor.profile: unconfined
lxc.cap.drop:
lxc.mount.auto: proc:mixed sys:mixed
From my understanding, binding /lib/modules to the container should solve the issue, but using
Code:
lxc.mount.entry: /lib/modules /lib/modules none rbind,ro,create=dir 0 0
is not doing anything and the container starts up with no error message.
Those are the ZFS related packages that I have installed inside the container:
Code:
libzfs6linux/stable,now 2.3.4-pve1 amd64 [installed]
zfs-dkms/stable,now 2.3.2-2 all [installed]
zfs-initramfs/stable,now 2.3.4-pve1 all [installed]
zfs-zed/stable,now 2.3.4-pve1 amd64 [installed]
zfsutils-linux/stable,now 2.3.4-pve1 amd64 [installed]

Maybe I am overlooking something obvious or someone has an idea where to start troubleshooting this.

Thanks for your help!