User Namespaces
Enable user namespaces
Requirements
First enable the sysctl:
Reload sysctl's with sysctl --system
User (G/U)IDs
Setup LXC mappings in /etc/lxc/default.conf
.
Edit shadow files for g/uids
Now add changed mapping to userns containers.
User Setup
Setup directories. Similar paths:
/etc/lxc/lxc.conf => ~/.config/lxc/lxc.conf
/etc/lxc/default.conf => ~/.config/lxc/default.conf
/var/lib/lxc => ~/.local/share/lxc
/var/lib/lxcsnaps => ~/.local/share/lxcsnaps
/var/cache/lxc => ~/.cache/lxc
Create zfs dataset for containers:
Add to fstab (double check it).
Let user create up to 10 bridges.
NOTE: May need to enable haveged.service
(I got gpg errors without it).
Create Container
References
https://wiki.archlinux.org/index.php/Linux_Containers#Enable_support_to_run_unprivileged_containers_.28optional.29
https://stgraber.org/2017/06/15/custom-user-mappings-in-lxd-containers/
https://stgraber.org/2014/01/17/lxc-1-0-unprivileged-containers/
Last updated