Table of Contents

LXC - Linux Containers

Ubuntu-specific LXC info

Resources

Basic setup

Unprivileged

  1. Prerequisites
  2. Create standard root-privileged container
  3. Remap that container's owner & group numbers to the user's subuid & subgid
  4. Move the container into the user's file space
  5. Run the unprivileged container

Prerequisites

Re-Mapping Container UIDs & GIDs

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

Extra Setup

lighttpd

MySQL

Minimal X Footprint

FreeSlack Template

Full text here ...

Full Package Set

CentOS/RHEL Specifics

To see available templates: ls -alh /usr/share/lxc/templates/
See official CentOS topic for further detail