Skip to content

Instantly share code, notes, and snippets.

@remotephone
Created August 20, 2018 02:38
Show Gist options
  • Save remotephone/000622db2cdc93a896bf0ad85c7cc198 to your computer and use it in GitHub Desktop.
Save remotephone/000622db2cdc93a896bf0ad85c7cc198 to your computer and use it in GitHub Desktop.
LXC Container with NFS Server permissions
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
@remotephone
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment