Hello there,
I don’t know if a should open a new subject but it seems that I have the same kind of errors. I have a LXD cluster, one of my container is a NFS server and another one is a client (nfs-common).
I’ve configured my export file as follows :
- /opt/share *(rw,sync,no_subtree_check)
The problem appears when I try to mount my share from the client
root@coruscant:~# sudo mount -t nfs4 192.168.0.53:/opt/share /tmp
mount.nfs4: access denied by server while mounting 192.168.0.53:/opt/share
The configuration for raw.apparmor looks like this on both container :
- fstype=rpc_pipefs,
- mount fstype=nfsd,
And the security.privileged is set to true.
if I do a dmesg | grep audit :
[156719.704077] audit: type=1400 audit(1563960827.890:569): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="lxd-coruscant_</var/snap/lxd/common/lxd>" pid=10789 comm="apparmor_parser"
[156720.220197] audit: type=1400 audit(1563960828.406:570): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lxd-coruscant_</var/snap/lxd/common/lxd>" pid=10832 comm="apparmor_parser"
[156721.933495] audit: type=1400 audit(1563960830.118:571): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/run/rpc_pipefs/" pid=10902 comm="mount" fstype="rpc_pipefs" srcname="sunrpc"
[156721.933525] audit: type=1400 audit(1563960830.118:572): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/run/rpc_pipefs/" pid=10902 comm="mount" fstype="rpc_pipefs" srcname="sunrpc" flags="ro"
[156737.337037] audit: type=1400 audit(1563960845.522:573): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/run/systemd/unit-root/" pid=10982 comm="(networkd)" srcname="/" flags="rw, rbind"
[156737.448751] audit: type=1400 audit(1563960845.634:574): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/run/systemd/unit-root/" pid=10984 comm="(resolved)" srcname="/" flags="rw, rbind"
[156776.456988] audit: type=1400 audit(1563960884.642:575): apparmor="STATUS" operation="profile_remove" profile="unconfined" name="lxd-najedha_</var/snap/lxd/common/lxd>" pid=11150 comm="apparmor_parser"
[156805.891536] audit: type=1400 audit(1563960914.074:576): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/tmp/" pid=11161 comm="mount.nfs4" fstype="nfs4" srcname="192.168.0.53:/opt/share"
[156813.173386] audit: type=1400 audit(1563960921.358:577): apparmor="STATUS" operation="profile_load" profile="unconfined" name="lxd-najedha_</var/snap/lxd/common/lxd>" pid=11183 comm="apparmor_parser"
[156891.399632] audit: type=1400 audit(1563960999.581:578): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxd-najedha_</var/snap/lxd/common/lxd>" name="/run/systemd/unit-root/" pid=11361 comm="(networkd)" srcname="/" flags="rw, rbind"
[156892.461966] audit: type=1400 audit(1563961000.645:579): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 profile="lxd-najedha_</var/snap/lxd/common/lxd>" name="/run/systemd/unit-root/" pid=11363 comm="(resolved)" srcname="/" flags="rw, rbind"
[157038.748558] audit: type=1400 audit(1563961146.933:580): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/bin/" pid=11803 comm="(ionclean)" flags="ro, remount, bind"
[157676.803317] audit: type=1400 audit(1563961784.984:581): apparmor="DENIED" operation="mount" info="failed type match" error=-13 profile="lxd-coruscant_</var/snap/lxd/common/lxd>" name="/tmp/" pid=11950 comm="mount.nfs4" fstype="nfs4" srcname="192.168.0.53:/opt/share"
I changed many times the apparmor’s settings … now it looks like this on both container
/etc/apparmor.d/lxc/lxc-default
profile lxc-container-default flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/lxc/container-base>
# the container may never be allowed to mount devpts. If it does, it
# will remount the host's devpts. We could allow it to do it with
# the newinstance option (but, right now, we don't).
deny mount fstype=devpts,
mount options=(rw, bind),
}
I’ve been looking on the internet for a while now, that’s why I come here to get some help.