LXC explained

Linux Containers
LXC
Released:[1]
Programming Language:C, Shell
Operating System:Linux
Platform:x86, IA-64, PowerPC, SPARC, Itanium, ARM
Genre:OS-level virtualization
License:GNU LGPL v.2.1 (some components under GNU GPL v2 and BSD)

Linux Containers (LXC) is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.

The Linux kernel provides the cgroups functionality that allows limitation and prioritization of resources (CPU, memory, block I/O, network, etc.) without the need for starting any virtual machines, and also the namespace isolation functionality that allows complete isolation of an application's view of the operating environment, including process trees, networking, user IDs and mounted file systems.[2]

LXC combines the kernel's cgroups and support for isolated namespaces to provide an isolated environment for applications.[3] Early versions of Docker used LXC as the container execution driver, though LXC was made optional in v0.9 and support was dropped in Docker v1.10.[4] [5]

Overview

LXC was initially developed by IBM, as part of a collaboration between several parties looking to add namespaces to the kernel.[6] It provides operating system-level virtualization through a virtual environment that has its own process and network space, instead of creating a full-fledged virtual machine. LXC relies on the Linux kernel cgroups functionality[7] that was released in version 2.6.24. It also relies on other kinds of namespace isolation functionality, which were developed and integrated into the mainline Linux kernel.

Security

Originally, LXC containers were not as secure as other OS-level virtualization methods such as OpenVZ: in Linux kernels before 3.8, the root user of the guest system could run arbitrary code on the host system with root privileges, just as they can in chroot jails.[8] Starting with the LXC 1.0 release, it is possible to run containers as regular users on the host using "unprivileged containers".[9] Unprivileged containers are more limited in that they cannot access hardware directly. However, even privileged containers should provide adequate isolation in the LXC 1.0 security model, if properly configured.

Alternatives

LXC is similar to other OS-level virtualization technologies on Linux such as OpenVZ and Linux-VServer, as well as those on other operating systems such as FreeBSD jails, AIX Workload Partitions and Solaris Containers. In contrast to OpenVZ, LXC works in the vanilla Linux kernel requiring no additional patches to be applied to the kernel sources. Version 1 of LXC, which was released on 20 February 2014 as a long-term supported version, was supported for five years.[10] LXC 4.0 will be supported until June 1, 2025 and LXC 5.0 until June 1, 2027.[11]

LXD

LXD is an alternative Linux container manager, written in Go. It is built on top of LXC and aims to provide a better user experience.[12] It is a container hypervisor providing an API to manage LXC containers.[13] The LXD project was started in 2015 and was sponsored from the start by Canonical Ltd., the company behind Ubuntu. On 4 July 2023, the LinuxContainers project announced that Canonical had decided to take over the LXD project but a fork called Incus was made.[14] [15] On August 25, 2023, LXD version 5.17 was officially released under the control of Canonical, providing support for OpenZFS 2.2 delegation capabilities.[16]

See also

External links

Notes and References

  1. Web site: Downloads . Linux containers . 2014-11-10 . 2014-11-10 . https://web.archive.org/web/20141110124113/https://linuxcontainers.org/downloads/ . dead .
  2. Web site: Resource management: Linux kernel namespaces and cgroups . May 2013 . February 11, 2015 . Rami Rosen . CS . UCSB.
  3. Web site: Kenlon . Seth . 2020-01-30 . Exploring simple Linux containers with lxc . IBM . 2023-07-05 . Red Hat.
  4. News: Docker 0.9: introducing execution drivers and libcontainer . 2014-03-10. Docker . Blog. 2018-05-09 . en-US.
  5. Web site: 1.10.0 . Docker . Engine release notes . 2016-02-04 . 2020-10-06.
  6. Web site: Webb . Jordan . 2022-09-13 . LXC and LXD: a different container story . 2023-07-05 . LWN.net.
  7. Web site: Koutoupis . Petros . 2018-08-27 . Everything You Need to Know about Linux Containers, Part II: Working with Linux Containers (LXC) . 2023-07-05 . Linux Journal.
  8. Web site: Marco . d'Itri . Evading from linux containers. BOFH . 12 February 2014 . IT . https://web.archive.org/web/20140109184419/http://blog.bofh.it/debian/id_413 . 9 January 2014. 2011.
  9. Web site: Graber. Stéphane. LXC 1.0: Security features [6/10]]. 12 February 2014. 1 January 2014. However, at least in Ubuntu, our default containers ship with what we think is a pretty good configuration of both the cgroup access and an extensive apparmor profile which prevents all attacks that we are aware of. [...] LXC is no longer running as root so even if an attacker manages to escape the container, he’d find himself having the privileges of a regular user on the host.
  10. Web site: LXC 1.0: Your first Ubuntu container . Stéphane . Graber . St. Graber . 2013-12-20 . 2014-02-23.
  11. Web site: LXC . Linux containers . 2023-02-07.
  12. Web site: Introduction . LXD . Linux Containers . 2020-04-14.
  13. Web site: Parrott . Thomas . Introduction to LXD projects . 2023-07-05 . Ubuntu . Canonical.
  14. Web site: 2023-07-04 . LXD Has been moved to Canonical . https://web.archive.org/web/20230704204731/https://linuxcontainers.org/lxd/ . 2023-07-04 . 2023-07-05 . Linux Containers.
  15. Web site: Rudra . Sourav . 2023-07-05 . The LXD Project Finds a New Home at Canonical . 2023-07-05 . It’s Foss.
  16. Web site: Parrott . Thomas . 25 August 2023 . LXD 5.17 has been released . Ubuntu . Canonical.