Failed to set LXC config: lxc.apparmor.profile=unconfined

Hi,

I use LXC/LXD on Plamo Linux. (I am maintainer of LXC/LXD on Plamo :slight_smile: )

Plamo’s kernel does not support AppArmor, so we build LXC without AppArmor.

When I upgrade LXD from 5.0.0 to 5.3, then the container do not start. (I am using LXC 5.0.0.)

$ lxc start c1
Error: Load go-lxc struct: Failed to set LXC config: lxc.apparmor.profile=unconfined
$ lxc info --show-log c1
  : (snip)
lxc 20220628110859.418 ERROR    confile - ../../Plamo-src/plamo/16_virtualization/lxc/lxc-5.0.0/src/lxc/confile.c:set_config_apparmor_profile:1645 - Invalid argument - Built without AppArmor support

I have done some research.

  • LXD 5.1, 5.2 with LXC 5.0.0: Same error.
  • LXD 5.0.0 with LXC 5.0.0: No error. A container is started.
  • LXD 5.3 with LXC 4.0.12: No error. A container is started.

Do you know what could be causing this? Is there something wrong with the build method? Or is it a misconfiguration?

Hi,

I did a little more research. Reverting this patch now works well.

Isn’t this improvement an error when trying to set lxc.apparmor.profile on liblxc without apparmor support?

Should I create an Issue on github?

Yes please can you create an issue at Issues · lxc/lxd · GitHub and reference the patch that broke it. Thanks! :slight_smile:

1 Like

@stgraber Thanks for your quick response!! :raised_hands: