LXC is a userspace interface for the Linux kernel containment
Through a powerful API and simple tools, it lets Linux users easily create and manage system or application containers.
Current LXC uses the following kernel features to contain processes:
- Kernel namespaces (ipc, uts, mount, pid, network and user)
- Apparmor and SELinux profiles
- Seccomp policies
- Chroots (using pivot_root)
- Kernel capabilities
- Control groups (cgroups)
As such, LXC is often considered as something in the middle between a chroot on steroids and a full fledged virtual machine. The goal of LXC is to create an environment as close as possible as a standard Linux installation but without the need for a separate kernel.
LXC is currently made of a few separate components:
- The liblxc library
- Several language bindings (python3, lua and Go)
- A set of standard tools to control the containers
- Container templates
LXC is free software, most of the code is released under the terms of the GNU LGPLv2.1+ license, some Android compatibility bits are released under a standard 2-clause BSD license and some binaries and templates are shipped under the GNU GPLv2 license.
Where do I get it?
git clone git://github.com/lxc/lxc
In your distribution
LXC is packaged by most current Linux distributions, you can then simply install it using your package manager.
Below are some useful links for some of the Linux distributions that are most active in LXC development:
- LXC RPMs in Public-Yum [ol6_latest] channel
- Latest test/development LXC RPMs in Public-Yum [ol6_playground_latest] channel
- Oracle Linux Administrator's Solutions Guide chapter about LXC
How do I use it?
More details are available in the individual manpages shipped with LXC itself. But a basic example of how to create, start and stop a container would be as follow:
lxc-create -t ubuntu -n p1 lxc-start -n p1 -d lxc-ls --fancy p1 lxc-stop -n p1
The above will create a basic Ubuntu container called "p1", then start it in the background, get various information about the container including its IP address and finally stop it.
An equivalent using the python3 API would be:
import lxc container = lxc.Container("p1") container.create("ubuntu") container.start() container.get_ips() container.stop()
How can I contribute to it?
Most development discussion happen on our
Patches are usually sent there for review and inclusion in
our master branch.
Frequent alpha releases and release candidates are tagged and packaged by some distributions.
Ubuntu users can also use our development packages available in ppa:ubuntu-lxc/daily
Where's the community?
As previously mentioned, most discussions happen on
We have two of those:
Some of us also hang out in #lxcontainers on irc.freenode.net
What about stable releases?
LXC's stable release is currently 0.9.0, released in April 2013.
The next stable release will be LXC 1.0, scheduled for release in early February 2014. LXC 1.0 will be the first LXC release to get an upstream maintained stable branch.
As a result, we will be releasing bugfix-only releases of LXC 1.0 until such time as nobody sends patches for inclusion. LXC 1.0 will be included in Ubuntu 14.04 LTS which comes with 5 years of security and bugfix updates, that work will be done directly upstream and Ubuntu will be shipping the standard upstream bugfix releases.