Failed to fork off sandboxing environment for executing generators: Protocol error

Yes you guys war correct. I hade the same problem. I have soft of found a workaround. I compared the contains of /etc/apparmor.d/abstractions/lxc/start-container from Ubuntu 22.04 and 24.04. And there are a few differences.

0a1

userns,
14c15
< mount → /usr/lib/x86_64-linux-gnu/lxc/{,**},


mount → /usr/lib/x86_64-linux-gnu/lxc/rootfs/{,**},
19a21,22
mount options=(rw, make-shared) → **,
mount options=(rw, make-rshared) → ,
20a24
mount fstype=fuse.*,
45c49
< pivot_root /usr/lib/x86_64-linux-gnu/lxc/{,
},


pivot_root /usr/lib/x86_64-linux-gnu/lxc/rootfs/{,**},

userns is clearly something that is 24.04 (does not work with 22.04).

So I would assume that the reason is the other lines. Anyway the 24.04 file works if you remove the userns line. Hope it helps.