OS-level virtualization is an
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
(OS)
virtualization paradigm in which the
kernel allows the existence of multiple isolated
user space
A modern computer operating system usually uses virtual memory to provide separate address spaces or regions of a single address space, called user space and kernel space. This separation primarily provides memory protection and hardware prote ...
instances, including containers (
LXC,
Solaris Containers, AIX
WPARs, HP-UX SRP Containers,
Docker,
Podman), zones (
Solaris Containers), virtual private servers (
OpenVZ), partitions, virtual environments (VEs), virtual kernels (
DragonFly BSD
DragonFly BSD is a free and open-source Unix-like operating system forked from FreeBSD 4.8. Matthew Dillon, an Amiga developer in the late 1980s and early 1990s and FreeBSD developer between 1994 and 2003, began working on DragonFly BSD in ...
), and jails (
FreeBSD jail and
chroot
chroot is a shell (computer), shell command (computing), command and a system call on Unix and Unix-like operating systems that changes the apparent root directory for the current running process and its Child process, children. A program that i ...
). Such instances may look like real computers from the point of view of programs running in them. A
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
running on an ordinary operating system can see all resources (connected devices, files and folders,
network shares, CPU power, quantifiable hardware capabilities) of that computer. Programs running inside a
container
A container is any receptacle or enclosure for holding a product used in storage, packaging, and transportation, including shipping.
Things kept inside of a container are protected on several sides by being inside of its structure. The term ...
can only see the container's contents and devices assigned to the container.
On
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems, this feature can be seen as an advanced implementation of the standard
chroot
chroot is a shell (computer), shell command (computing), command and a system call on Unix and Unix-like operating systems that changes the apparent root directory for the current running process and its Child process, children. A program that i ...
mechanism, which changes the apparent root folder for the current running process and its children. In addition to isolation mechanisms, the kernel often provides
resource-management features to limit the impact of one container's activities on other containers. Linux containers are all based on the virtualization, isolation, and resource management mechanisms provided by the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
, notably
Linux namespaces and
cgroups.
Although the word ''container'' most commonly refers to OS-level virtualization, it is sometimes used to refer to fuller
virtual machine
In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
s operating in varying degrees of concert with the host OS, such as
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
's
Hyper-V containers. For an overview of
virtualization since 1960, see
Timeline of virtualization technologies.
Operation
On ordinary operating systems for personal computers, a computer program can see (even though it might not be able to access) all the system's resources. They include:
* Hardware capabilities that can be employed, such as the
CPU and the network connection
* Data that can be read or written, such as files, folders and
network shares
* Connected
peripheral
A peripheral device, or simply peripheral, is an auxiliary hardware device that a computer uses to transfer information externally. A peripheral is a hardware component that is accessible to and controlled by a computer but is not a core compo ...
s it can interact with, such as
webcam
A webcam is a video camera which is designed to record or stream to a computer or computer network. They are primarily used in Videotelephony, video telephony, live streaming and social media, and Closed-circuit television, security. Webcams can b ...
,
printer, scanner, or fax
The operating system may be able to allow or deny access to such resources based on which program requests them and the
user account
A user is a person who uses a computer or network service.
A user often has a user account and is identified to the system by a username (or user name).
Some software products provide services to other systems and have no direct end use ...
in the context in which it runs. The operating system may also hide those resources, so that when the computer program enumerates them, they do not appear in the enumeration results. Nevertheless, from a programming point of view, the computer program has interacted with those resources and the operating system has managed an act of interaction.
With operating-system-virtualization, or containerization, it is possible to run programs within containers, to which only parts of these resources are allocated. A program expecting to see the whole computer, once run inside a container, can only see the allocated resources and believes them to be all that is available. Several containers can be created on each operating system, to each of which a subset of the computer's resources is allocated. Each container may contain any number of computer programs. These programs may run concurrently or separately, and may even interact with one another.
Containerization has similarities to
application virtualization
Application virtualization is a software technology that encapsulates computer programs from the underlying operating system on which they are executed. A fully virtualized application is not installed in the traditional sense, although it is sti ...
: In the latter, only one computer program is placed in an isolated container and the isolation applies to file system only.
Uses
Operating-system-level virtualization is commonly used in
virtual hosting environments, where it is useful for securely allocating finite hardware resources among a large number of mutually-distrusting users. System administrators may also use it for consolidating server hardware by moving services on separate hosts into containers on the one server.
Other typical scenarios include separating several programs to separate containers for improved security, hardware independence, and added resource management features. The improved security provided by the use of a chroot mechanism, however, is not perfect. Operating-system-level virtualization implementations capable of
live migration can also be used for dynamic
load balancing of containers between nodes in a cluster.
Overhead
Operating-system-level virtualization usually imposes less overhead than
full virtualization because programs in OS-level virtual partitions use the operating system's normal
system call
In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
interface and do not need to be subjected to
emulation or be run in an intermediate
virtual machine
In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
, as is the case with full virtualization (such as
VMware ESXi,
QEMU
The Quick Emulator (QEMU) is a free and open-source emulator that uses dynamic binary translation to emulate a computer's processor; that is, it translates the emulated binary codes to an equivalent binary format which is executed by the mach ...
, or
Hyper-V) and
paravirtualization (such as
Xen or
User-mode Linux). This form of virtualization also does not require hardware support for efficient performance.
Flexibility
Operating-system-level virtualization is not as flexible as other virtualization approaches since it cannot host a guest operating system different from the host one, or a different guest kernel. For example, with
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, different distributions are fine, but other operating systems such as Windows cannot be hosted. Operating systems using variable input systematics are subject to limitations within the virtualized architecture. Adaptation methods including cloud-server relay analytics maintain the OS-level virtual environment within these applications.
Solaris partially overcomes the limitation described above with its
branded zones feature, which provides the ability to run an environment within a container that emulates an older
Solaris 8 or 9 version in a Solaris 10 host. Linux branded zones (referred to as "lx" branded zones) are also available on
x86-based Solaris systems, providing a complete Linux
user space
A modern computer operating system usually uses virtual memory to provide separate address spaces or regions of a single address space, called user space and kernel space. This separation primarily provides memory protection and hardware prote ...
and support for the execution of Linux applications; additionally, Solaris provides utilities needed to install
Red Hat Enterprise Linux 3.x or
CentOS 3.x
Linux distribution
A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s inside "lx" zones. However, in 2010 Linux branded zones were removed from Solaris; in 2014 they were reintroduced in
Illumos
Illumos (stylized as "illumos") is a partly free and open-source Unix operating system. It has been developed since 2010 and is based on OpenSolaris, after the discontinuation of that product by Oracle. It comprises a kernel, device driver ...
, which is the
open source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
Solaris fork, supporting 32-bit
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
s.
Storage
Some implementations provide file-level
copy-on-write (CoW) mechanisms. (Most commonly, a standard file system is shared between partitions, and those partitions that change the files automatically create their own copies.) This is easier to back up, more space-efficient and simpler to cache than the block-level copy-on-write schemes common on whole-system virtualizers. Whole-system virtualizers, however, can work with non-native file systems and create and roll back snapshots of the entire system state.
Implementations
Linux containers not listed above include:
*
LXD, an alternative wrapper around
LXC developed by
Canonical
*
Podman, an advanced Kubernetes ready root-less secure drop-in replacement for Docker with support for multiple container image formats, including OCI and Docker images
*
Charliecloud, a set of container tools used on HPC systems
*
Kata Containers MicroVM Platform
* Bottlerocket is a Linux-based open-source operating system that is purpose-built by
Amazon Web Services
Amazon Web Services, Inc. (AWS) is a subsidiary of Amazon.com, Amazon that provides Software as a service, on-demand cloud computing computing platform, platforms and Application programming interface, APIs to individuals, companies, and gover ...
for running containers on virtual machines or bare metal hosts
*
Azure Linux is an open-source Linux distribution that is purpose-built by
Microsoft Azure and similar to
Fedora CoreOS
See also
*
Container Linux
*
Container orchestration
*
Flatpak package manager
*
Linux cgroups
*
Linux namespaces
*
Hypervisor
*
Portable application creators
*
Open Container Initiative
*
Sandbox (software development)
A sandbox is a testing environment that isolates untested code changes and outright experimentation from the production environment or repository in the context of software development, including web development, automation, revision control, ...
*
Separation kernel
*
Serverless computing
Serverless computing is "a cloud service category in which the customer can use different cloud capability types without the customer having to provision, deploy and manage either hardware or software resources, other than providing customer appli ...
*
Snap package manager
*
Storage hypervisor
*
Virtual private server (VPS)
*
Virtual resource partitioning
Notes
References
External links
An introduction to virtualization
A short intro to three different virtualization techniquesVirtualization and containerization of application infrastructure: A comparison June 22, 2015, by Mathijs Jeroen Scheepers
Containers and persistent data LWN.net, May 28, 2015, by Josh Berkus
{{DEFAULTSORT:Operating-system-level virtualization
Operating system security
Virtualization
Linux
Linux containerization
Linux kernel features