LXC containers in practical use on the desktop

Slashdot it! Delicious Share on Facebook Tweet! Digg!
iceman0, morguefile.com

iceman0, morguefile.com

Freshly Packaged

LXC containers are not just for developers. Adventurous users can also find uses for them.

Containers is the current buzzword in terms of application development and cloud computing and has been ever since Docker achieved notoriety about a year and a half ago. We've reported on containers previously and predicted that end users will also benefit from this new free technology. In this article, I'll explore how things might look in time.

Some readers might remember the first appearance of the free VirtualBox hypervisor in 2007 that made Linux distribution testing easier. Previously, there was the VMware Player, but VMware is not free and there was the constant problem of update breaking and having to wait for the latest kernel patch to make things work again.

With VirtualBox and help from DKMS [1] such problems are a thing of the past, and ISO images of the newest distribution can be prepared for testing in a matter of minutes. The only limitation to the number of simultaneously bootable distributions is main memory and processor speed. Here, container solutions can make headway with end users, because their resource superstructure is much less resource-hungry than that of hypervisors. Hundreds of containers can theoretically share the same host kernel. Containers virtualize at the operating system level, whereas with hypervisors this happens on hardware.

In this article, therefore, I'll test how easy it now is to get a container to run on a distribution, with the graphical output redirected to the host.

Old Technology Revitalized

Containers aren't as new as many think; in fact, Linux Containers (LXC) [2] have been around since 2006 but didn't acquire a large user base until the spring of 2013 when Docker [3] appeared on the scene. Outside of Linux, similar technologies already existed, such as FreeBSD Jail [4] or the Solaris Zones [5] that were originally built on Jails.

The granddaddy of all these is, of course, the well-known Unix chroot [6], even if the application scenarios are different. In a chroot, it might be desirable for a process to "break" from an environment, which is something that can't happen in containers.

Exaggerated Hype!?

The current hype about Docker and containers in general comes from the fact that increasingly specialized applications are making their way into the business environment, pushing out the more static software stacks of the past.

The easily copied, lightweight, and portable containers are particularly well-suited for developing applications as modules from local computers, to servers and the cloud. What I'm interested in here, however, are the qualities of the LXC and Docker container solutions for end users.

I will start with LXC and attempt to open a container on an installed Ubuntu 14.10 with a CentOS image on it (Figure 1). Ubuntu will be used as the host, because the default kernel and system settings are the most user-friendly.

Figure 1: LXC installs all the required dependencies.

Here also the lxcbr0 network bridge is already integrated, which requires somewhat more configuration in Debian. The goal is to get to a functioning container up and running as easily as possible.

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $0.99
(incl. VAT)

Buy Ubuntu User

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content