Portál AbcLinuxu, 21. května 2025 02:05
This article briefly describes container (OS-level) virtualization implementations in GNU/Linux systems.
Container virtualization provides simple and lightweight way to create and use virtual machines on a single host machine. Virtual machines share the same kernel with the host machine and the resources of the host machine are rather isolated than virtualized. Container virtualization has very small overhead compared to other types of virtualization. Nevertheless, it has its limitations, e.g. the fact that virtual machines can't use their own kernels. It is also impossible to virtualize some resources (typically the hardware clock). For more information on container virtualization in general please visit OpenVZ wiki or Wikipedia article on OS-level virtualization.
This article focuses on three best-known vitrualization techniques in GNU/Linux - Linux-VServer, OpenVZ and Linux Containers.
All these systems share these properties and features (which are typical for container virtualization implementations):
The following paragraphs focus on particular implementations and emphasize their unique features.
This technology offers basic features needed for virtualization.
One of interesting features are copy on write filesystems (data is shared between the host and the virtual machines and are copied as soon as it's changed) that saves the disk space.
Linux-VServer doesn't virtualize network resources using virtual network devices. It only isolates the network communication of the individual virtual servers instances, which implies the fact there is no way to perform advanced network tasks (e.g. define iptables rules) inside the virtual servers. On the other hand this method doesn't introduce almost any overhead in the network communication (as opposed to the following virtualization solutions used by OpenVZ and LXC).
Linux-VServer makes use of patched Linux kernel and is not supported by libvirt.
For exhaustive information about this technology visit: Linux-VServer paper and Linux-VServer - List of supported features.
This opensource project is a part of rich (and commercial) virtualization solution called Virtuozzo Containers developed by Parallels.
The unique feature of this solution is the possibility of checkpointing and migration that allows, among other things, the live migration of virtual machines without noticeable delays.
The network in OpenVZ is virtualized - the possibilities of setting network within virtual machines are much wider in comparison with the previous solution (e.g. it is possible to set up a firewall or network routes for virtual machines).
OpenVZ doesn't support copy on write filesystem sharing (as opposed to Linux-VServer) out of the box (something similar can be achieved by using LVM magic but it is not officially supported). This feature is available in the Virtuozzo project.
OpenVZ requires patched kernel for its run. It is supported by libvirt.
Exhausting information on OpenVZ can be found on OpenVZ wiki.
This solution makes heavy use of Linux Control groups mechanisms that have been included in the kernel (since 2.6.24). Cgroups make it possible to limit system resources for a given group of processes. It supports copy on write mechanism and libvirt.
LXC is the newest project (compared to Linux-VServer and OpenVZ) and it doesn't provide such a variety of possibilities as the feature-richer OpenVZ. It is also not as mature as the other implementations (there were some security flaws, e.g. the possibility of evading the container). Its integration in the kernel can however result in the widening this implementation solution and in implementing missing features.
For more information see the kernel documentation about cgroups and LXC project page.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.