/etc/lxc/default.conf
:lxc.network.type=veth lxc.network.link=br0 lxc.network.flags=up
lxc.hook.autodev = sh -c "modprobe tun ; cd ${LXC_ROOTFS_MOUNT}/dev ; mkdir net ; mknod net/tun c 10 200 ; chmod 0666 net/tun" lxc.cgroup.devices.allow = c 10:200 rwm
lxc-create -n lxcguest -t /usr/share/lxc/templates/lxc-freeslack
config
and:lxc.network.hwaddr = DE:AD:BE:EF:00:00
/etc/rc.d/rc.inet1.conf
lxc-start -n lxcguest -d
lxc-console -n lxcname
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 {} }
/etc/cgrules.conf
:rk4n3 * lxc/
usermod --add-subuids 100000-165536 rk4n3 usermod --add-subgids 100000-165536 rk4n3
cgconfig
(1st) and cgred
(2nd) services, verify with: lscgroup
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
lighttpd
(preferred)lighttpd2
(experimental)UNWIND=yes
to lighttpd2 slackbuild)libaio
and jemalloc
To see available templates: ls -alh /usr/share/lxc/templates/
See official CentOS topic for further detail