This is an old revision of the document!
/etc/lxc/default.conf
:lxc.network.type=veth lxc.network.link=br0 lxc.network.flags=up
lxc-create -n lxcguest -t /usr/share/lxc/templates/lxc-slackware
config
and set MAC for virtual NIC: lxc.network.hwaddr = DE:AD:BE:EF:00:00
lxc-start -n lxcguest -d
lxc-console -n lxcguest
See: Unprivileged containers in Slackware
libcgroup-0.41-x86_64-2_slack14.2
/etc/cgconfig.conf
: group lxc { perm { task { uid = rk4n3; gid = rk4n3; } admin { uid = rk4n3; gid = rk4n3; } } cpuset { cgroup.clone_children = 1; cpuset.mems = 0; cpuset.cpus = 0-3; } cpu {} cpuacct {} blkio {} memory { memory.use_hierarchy = 1; } devices {} freezer {} net_cls {} perf_event {} net_prio {} }
As root:
usermod --add-subuids 100000-165536 rk4n3 usermod --add-subgids 100000-165536 rk4n3
Acquire uidmapshift.c
and container-userns-convert
from: nsexec tools
Build uidmapshift
with:
gcc -o uidmapshift uidmapshift.c
Near the end of the container-userns-convert , around line 61, change the call to uidmapshift
to be $PATHTOYOUR/uidmapshift, then make container-userns-convert executable.
Perform the actual conversion with (as root):
./container-userns-convert yourcontainername 100000
In $HOME/.config/lxc/default.conf
:
lxc.network.type = veth lxc.network.link = br0 lxc.network.flags = up lxc.network.hwaddr = DE:AD:BE:EF:xx:xx lxc.id_map = u 0 100000 65536 lxc.id_map = g 0 100000 65536
In /etc/lxc/lxc-usernet
:
rk4n3 veth br0 10
libaio
and jemalloc