I created multiple unprivileged LXC containers successfully. However they all have the same UID and GID as follow:

ls -l /.local/share/lxc
total 12
drwxrwx--- 3 100000 js 4096 Jan 21 20:20 js-hp-lxc-001
drwxrwx--- 3 100000 js 4096 Jan 21 20:22 js-hp-lxc-002
drwxrwx--- 3 100000 js 4096 Jan 21 20:22 js-hp-lxc-003

Can/Should they have different UID? If so, how can I do it?

My concern is about security between containers.

  • Any info on that? I was thinking the same thing... Atm I am modifying the mapping (added 65536*10 u/gids) but I have to do this manually since the default settings always use 0 100000 65536 + I have to sudo chown the rootfs and containing folder. – urban Feb 25 '16 at 19:18
  • It seems there is no definite answer for that. I myself is using script to create those config files. – John Siu Feb 25 '16 at 19:21
  • Cheers man for the fast response! I am thinking of doing the same... or wait to upgrade to ubuntu 15 and test with LXD ... – urban Feb 25 '16 at 19:23
  • I am using 16.04 and the latest lxc 2.0 package, seems very smooth. If you are interested I can upload my scripts to github. But they are very much tailored to my current config and not very flexible yet. – John Siu Feb 25 '16 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.