Skip to content

Instantly share code, notes, and snippets.

@kevin39
Created March 2, 2017 10:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevin39/aab9d8ff075e792eb0feb50fdcac5c61 to your computer and use it in GitHub Desktop.
Save kevin39/aab9d8ff075e792eb0feb50fdcac5c61 to your computer and use it in GitHub Desktop.
NFSD on LXC
Create a new file "/etc/apparmor.d/lxc/lxc-default-with-nfsd" and paste in the following;
Code:
# 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/**,
}
Then run this command to reload the profiles
Code:
apparmor_parser -r /etc/apparmor.d/lxc-containers
Finally at this line to your /etc/pve/lxc/CTID.conf
Code:
lxc.aa_profile = lxc-container-default-with-nfsd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment