Hi,
I am running a NFS kernel server inside a (privileged) Incus container, based on Debian containers. Up to Debian 12, things worked fine, but I find that when migrating to Debian 13, they stop working. I debugged it to the point where it seems that mounting the nfsd filesystem inside the container is prevented by apparmor, even when I have allowed mounting fstype=nfsd for that container.
Here is how to reproduce it:
Incus configuration for running kernel nfsserver inside container:
# incus profile show nfs
config:
raw.apparmor: mount fstype=rpc_pipefs, mount fstype=nfsd,
security.privileged: “true”
description: Configuration for kernel NFS server.
devices: {}
name: nfs
used_by:
- /1.0/instances/generic-nfs-13
- /1.0/instances/generic-nfs-12
project: default
Debian 12:
# incus launch images:debian/12 generic-nfs-12
# incus profile add generic-nfs-12 nfs
# incus exec generic-nfs-12 apt -y install nfs-kernel-server
# incus exec generic-nfs-12 – showmount -e localhost
Export list for localhost:
Success!
Debian 13:
# incus launch images:debian/13 generic-nfs-13
# incus profile add generic-nfs-13 nfs
# incus exec generic-nfs-13 apt -y install nfs-kernel-server
# incus exec generic-nfs-13 – showmount -e localhost
clnt_create: RPC: Program not registered
Failure!
# incus exec generic-nfs-13 – /bin/bash -l
root@generic-nfs-13:~# mount -t nfsd nfsd /proc/fs/nfsd
mount: /proc/fs/nfsd: nfsd already mounted or mount point busy.
dmesg(1) may have more information after failed mount system call.
dmesg shows this error message:
[73099.511111] audit: type=1400 audit(1768135248.999:496): apparmor=“DENIED” operation=“mount” class=“mount” info=“failed type match” error=-13 profile=“incus-generic-nfs-13_</var/lib/incus>” name=“/proc/fs/nfsd/” pid=154101 comm=“mount” flags=“rw, move”
So, it looks like the same raw.apparmor config “mount fstype=nfsd” allows mounting the nfsd configuration filesystem in a Debian 12 container, but not in a Debian 13 container. This seems to be odd.
Can anyone give me a hint on how to change the Incus apparmor configuration line in order to allow mounting the nfsd filesystem in a Debian 13 container?