sudo apt-get install lxc uidmap
sudo lxc-checkconfig
sudo adduser lxcuser
# Allocate subgid and subuid to lxcuser
sudo usermod --add-subuids 100000-165536 lxcuser
sudo usermod --add-subgids 100000-165536 lxcuser
sudo chmod +x /home/lxcuser
# create ~/.config/lxc/default.conf
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
lxc.id_map = u 0 100000 65536 # OR adjust for autocreated values in /etc/subuid
lxc.id_map = g 0 100000 65536 # same as above for /etc/subgid
logout
# Create /etc/lxc/lxc-usernet
# USERNAME TYPE BRIDGE COUNT
lxcuser veth lxcbr0 10 # max of 10 containers
grep lxcuser /etc/sub* 2>/dev/null # verify subgid & subuid assigned
# Log out/restart, log in as lxcuser
# Download the special image/rootfs:
lxc-create -t download -n unprivileged -- -d ubuntu -r trusty -a amd64
## download is a special type
# start the container
lxc-start -n unprivileged -d
# list container IP
lxc-ls --fancy
# ssh in and enjoy (login/pass: ubuntu/ubuntu)