Created
August 20, 2018 02:38
-
-
Save remotephone/000622db2cdc93a896bf0ad85c7cc198 to your computer and use it in GitHub Desktop.
LXC Container with NFS Server permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create this a file at /etc/apparmor.d/lxc/lxc-default-with-nfsd and add this content: | |
# Do not load this file. Rather, load /etc/apparmor.d/lxc-containers, which | |
# will source all profiles under /etc/apparmor.d/lxc | |
profile lxc-container-default-with-nfsd 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 fstype=nfsd, | |
mount fstype=rpc_pipefs, | |
mount fstype=cgroup -> /sys/fs/cgroup/**, | |
} | |
Edit /etc/pve/lxc/<CTID>.conf and add this line to the end: | |
lxc.apparmor.profile = lxc-container-default-with-nfsd | |
Reboot the container | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from here: https://forum.proxmox.com/threads/is-it-possible-to-run-a-nfs-server-within-a-lxc.24403/ but had to change the container config with details from here: https://www.reddit.com/r/Proxmox/comments/8eesbb/lxc_container_nfs_server/