Chooseing apparmor config on lxc creation

aghadjip

Well-Known Member
Jan 22, 2019
33
7
48
44
Hey Folks,

I have an apparmor profile *_with_NFS that I add to LXCs that need NFS. I rather not all containers get this config. It would be nice to be able to define an lxc at creation to use various profiles. Is this possible? Rather not have to edit each container config file.

How are others doing it?
 
You can just set this through the WebUI, go to the Cóntainers Option Tab and Edit the "Features" entry:
View attachment 9299
Oh thats fun, thanks. do you happen to know the values that each item injects? Does it write to the lxc config directly or have another method. Is there a corresponding API value for that setting? It would make automating easier.
 
Is there a corresponding API value for that setting
Yes, the WebUI wraps a bit around to make it less complicated, as normally you could set other FStypes too. You can set it via CLI with:

Code:
pct set 103 --features mount=nfs;cifs;fuse

(this time besides nfs also fuse and cifs would be allowed) or over API see: https://pve.proxmox.com/pve-docs/api-viewer/index.html
and go to the /nodes/{node}/lxc/{vmid}/config in the sidepanel