Installing LXC
At the time of writing this book, there are two long-term support versions of LXC: 1.0 and 2.0. The userspace tools that they provide have some minor differences in command-line flags and deprecations, which I'll be pointing out as we use them.
Installing LXC on Ubuntu with apt
Let's start by installing LXC 1.0 on Ubuntu 14.04.5 (Trusty Tahr):
- Install the main LXC package, tooling, and dependencies:
root@ubuntu:~# lsb_release -dc Description: Ubuntu 14.04.5 LTS Codename: trusty root@ubuntu:~# apt-get -y install -y lxc bridge-utils debootstrap libcap-dev cgroup-bin libpam-systemdbridge-utils root@ubuntu:~#
- The package version that Trusty Tahr provides at this time is 1.0.8:
root@ubuntu:~# dpkg --list | grep lxc | awk '{print $2,$3}' liblxc1 1.0.8-0ubuntu0.3 lxc 1.0.8-0ubuntu0.3 lxc-templates 1.0.8-0ubuntu0.3 python3-lxc 1.0.8-0ubuntu0.3 root@ubuntu:~#
To install LXC 2.0, we'll need the Backports repository:
- Add the following...