lxc.namespace.share.pid = test
lxc.namespace.share.user = test
But in just:
lxc.namespace.share.user = test
You’d need to do something like:
printf "lxc.namespace.share.user=test\nlxc.namespace.share.user=test" | lxc config set c4 raw.lxc -
I doubt that this would fix the problem though, sharing user namespace for privileged containers doesn’t really make sense and sharing pid namespace is going to cause you some major issues as the init process of the second container will immediately fail.
Thanks Stephane, for correction. I did change that to reflect it correctly and also changed the privileges for both containers but it still doesn’t work.
Documentation for lxc 3.0.0 however, seems to suggest that lxc.namespace.share works with sharing user and net namespace.
Right but you’re trying to share user and pid here which is a bit different.
Also sharing the user namespace is meaningless when the containers are privileged since they by definition do not have a user namespace.
To inherit the namespace from another container set the lxc.namespace.share.[namespace identifier] to the name of the container, e.g. lxc.namespace.share.pid = c3.