Containers are light weight virtual machines that can be used to isolate processes. Containers implement operating system level virtualization. This means that all containers running on a host will share the kernel of the host operating system.
The main difference between Containers and Hyper-Visors such as XEN and KVM is that the later implements hardware level virtualization. This means a host system running XEN or KVM can run virtual machines with different kernels.
The main container technologies in use today are Docker and LXC/LXD. LXD is a refinement of LXC and is based on LXC. Until recently OpenVZ was a popular choice for containers. It has now been replaced by containers based on CGroups.
CGroups is a new feature of the Linux kernel that allows process isolation. Both Docker and LXC are based on CGroups. Since the Linux kernel now has built in support for containers, old container technologies such as OpenVZ have been largely replaced by Docker and LXC.
The installation of LXC on Debian Jessie is very simple and only requires the command: apt-get install lxc. The LXC home page has useful information on how to get started with LXC
To create a new LXC container, we have to run the command: lxc-create -t download -n your-container-name. This will display a list of options for the operating system. Once you have selected your operating system, the template for your selected operating system will be downloaded and the new container will be created.
Here are some commands for using containers:
The Debian Wiki LXC page covers the basics of LXC container management including setting up networking and mounting external folder shares. According to the Wiki, there are three main options for configuring networking on LXC. Using a simple Bridge, Vlan networking and setting up a network based on LibVirt.
LXC containers are very easy to use. They allow easily testing new software without interfering with the main host. They are also light weight and do not take lot of server resources. LXC containers can be used to logically sub divide your computing work into groups. I use LXC containers for my website development work and find them very useful.