Search code examples
lxcapparmor

Can not set lxc.apparmor.profile


I can not disable apparmor for lxc container:

$ lxc launch images:centos/7 a1
Creating a1
Starting a1
$ lxc config set a1 lxc.apparmor.profile unconfined
Error: Invalid config: Unknown configuration key: lxc.apparmor.profile
$ lxc --version
3.0.3

What's wrong and how to set property ?


Solution

  • It's an LXC setting for an LXD container. So it should be set as:

    lxc config set a1 raw.lxc "lxc.apparmor.profile=unconfined"
    

    or the previous property before version 3:

    lxc config set a1 raw.lxc "lxc.aa_profile=unconfined"