OSレベルの仮想化

出典: フリー百科事典『ウィキペディア(Wikipedia)』

OSレベルの仮想化(英:OS-level virtualization)とは、オペレーティングシステム(OS)の枠組みで、コンテナ(LXC、Solaris containers、Docker、Podman)、zones(Solaris containers)、virtual private servers(OpenVZ)、パーティション、仮想環境(VEs)、仮想カーネル(DragonFly BSD)、jails(FreeBSD jailまたはchroot jail)[1]と呼ばれる、複数の分離したユーザー空間インスタンスをカーネルによって割り当てる。このようなインスタンスはその中で実行されているプログラムからの視点では実際のコンピュータのように見えることがある。通常のOS上で動作するコンピュータプログラムは、そのコンピュータのすべての資源(接続されているデバイス、ファイルやフォルダ、ネットワーク共有、CPU性能、定量化できるハードウェア能力)を見ることができる。しかし、コンテナ内で動作するプログラムは、コンテナの内部とコンテナに割り当てられたデバイスしか見ることができない。

Unix系OSではこの機能は現在実行中のプロセスとその子プロセスの見かけ上のルートフォルダを変更する、標準的なchrootメカニズムの高度な実装と見なすことができる。カーネルはしばしばアイソレーションメカニズムに加えて、あるコンテナの活動が他のコンテナに与える影響を制限するための資源管理機能を提供する。Linuxコンテナは、Linuxカーネルが提供する仮想化、アイソレーション、資源管理のメカニズム、特に Linux名前空間cgroupsをベースにしている[2]

コンテナという用語は、OSレベルの仮想化システムを指すのが一般的だが、MicrosoftHyper-Vコンテナのように、ホストOSとさまざまなレベルで協調して動作する完全な仮想マシン環境を指すのにも多義的に使用されることがある。

実装[編集]

機構 オペレーティング·システム ライセンス 以降またはその間に活発に開発された 特徴
ファイル システムの分離 書き込み時にコピー ディスク クォータ I/O レート制限 メモリ制限 CPU クォータ ネットワーク分離 ネストされた仮想化 パーティションのチェックポイントとライブ マイグレーション ルート権限の分離
chroot ほとんどのUNIX系OS オペレーティング システムによって異なる 1982 部分的[注釈 1] No No No No No No Yes No No
Docker Linux,[4] FreeBSD,[5] Windows x64 (Pro, Enterprise and Education)[6] macOS[7] アパッチ ライセンス 2.0 2013 Yes Yes Not directly Yes (since 1.10) Yes Yes Yes Yes Only in Experimental Mode with CRIU [1] Yes (since 1.10)
Linux-VServer(security context) Linux, Windows Server 2016 GNU GPLv2 2001 Yes Yes Yes Yes[注釈 2] Yes Yes 部分的[注釈 3] ? No Partial[注釈 4]
lmctfy Linux アパッチ ライセンス 2.0 2013 – 2015 Yes Yes Yes Yes[注釈 2] Yes Yes 部分的[注釈 3] ? No Partial[注釈 4]
LXC Linux GNU GPLv2 2008 Yes[9] Yes 部分的[注釈 5] 部分的[注釈 6] Yes Yes Yes Yes Yes Yes[9]
Singularity Linux BSD ライセンス 2015[10] Yes[11] Yes Yes No No No No No No Yes[12]
OpenVZ Linux GNU GPLv2 2005 Yes Yes[13] Yes Yes[注釈 7] Yes Yes Yes[注釈 8] 部分的[注釈 9] Yes Yes[注釈 10]
Virtuozzo Linux, Windows トライアルウェア 2000[17] Yes Yes Yes Yes[注釈 11] Yes Yes Yes[注釈 8] 部分的[注釈 12] Yes Yes
Solaris Containers (Zones) illumos (OpenSolaris),
Solaris
CDDL、

独自

2004 Yes Yes (ZFS) Yes 部分的[注釈 13] Yes Yes Yes[注釈 14][20][21] 部分的[注釈 15] 部分的[注釈 16][注釈 17] Yes[注釈 18]
FreeBSD jail FreeBSD, DragonFly BSD BSD ライセンス 2000[23] Yes Yes (ZFS) Yes[注釈 19] Yes Yes[24] Yes Yes[25] Yes 部分的[26][27] Yes[28]
vkernel DragonFly BSD BSD ライセンス 2006[29] Yes[30] Yes[30] N/A ? Yes[31] Yes[31] Yes[32] ? ? Yes
sysjail OpenBSD, NetBSD BSD ライセンス 2006–2009 Yes No No No No No Yes No No ?
WPARs AIX 商用 のプロプライエタリ ソフトウェア 2007 Yes No Yes Yes Yes Yes Yes[注釈 20] No Yes[34] ?
iCore Virtual Accounts Windows XP フリーウェア 2008 Yes No Yes No No No No ? No ?
Sandboxie Windows GNU GPLv3 2004 Yes Yes 部分的 No No No 部分的 No No Yes
systemd-nspawn Linux GNU LGPLv2.1+ 2010 Yes Yes Yes[35][36] Yes[35][36] Yes[35][36] Yes[35][36] Yes ? ? Yes
Turbo Windows フリーミアム 2012 Yes No No No No No Yes No No Yes
rkt Linux アパッチ ライセンス 2.0 2014[37]–2018 Yes Yes Yes Yes Yes Yes Yes ? ? Yes

上記以外のLinuxコンテナには以下のようなものがある。

  • LXD, Canonicalによって開発されたLXCの代替ラッパー[38]
  • Podman[39]: Dockerのドロップイン代替品
  • Charliecloud: HPCシステムで使用されるコンテナ・ツールの一式[40]
  • Kata Containers MicroVMプラットフォーム[41]
  • Bottlerocketは、仮想マシンやベアメタルホスト上でコンテナを実行するためにAmazon Web Servicesが専用に開発したLinuxベースのオープンソース・オペレーティング・システムである[42]
  • CBL-Marinerは、Microsoft Azureが開発したオープンソースのLinuxディストリビューションで、Fedora CoreOSに類似している。

関連項目[編集]

脚注[編集]

注釈[編集]

  1. ^ Root user can easily escape from chroot. Chroot was never supposed to be used as a security mechanism.[3]
  2. ^ a b Using the CFQ scheduler, there is a separate queue per guest.
  3. ^ a b Networking is based on isolation, not virtualization.
  4. ^ a b A total of 14 user capabilities are considered safe within a container. The rest may cannot be granted to processes within that container without allowing that process to potentially interfere with things outside that container.[8]
  5. ^ Disk quotas per container are possible when using separate partitions for each container with the help of LVM, or when the underlying host filesystem is btrfs, in which case btrfs subvolumes are automatically used.
  6. ^ I/O rate limiting is supported when using Btrfs.
  7. ^ Available since Linux kernel 2.6.18-028stable021. Implementation is based on CFQ disk I/O scheduler, but it is a two-level schema, so I/O priority is not per-process, but rather per-container.[14]
  8. ^ a b Each container can have its own IP addresses, firewall rules, routing tables and so on. Three different networking schemes are possible: route-based, bridge-based, and assigning a real network device (NIC) to a container.
  9. ^ Docker containers can run inside OpenVZ containers.[15]
  10. ^ Each container may have root access without possibly affecting other containers.[16]
  11. ^ Available since version 4.0, January 2008.
  12. ^ Docker containers can run inside Virtuozzo containers.[18]
  13. ^ Yes with illumos[19]
  14. ^ See OpenSolaris Network Virtualization and Resource Control for more details.
  15. ^ Only when top level is a KVM zone (illumos) or a kz zone (Oracle).
  16. ^ Starting in Solaris 11.3 Beta, Solaris Kernel Zones may use live migration.
  17. ^ Cold migration (shutdown-move-restart) is implemented.
  18. ^ Non-global zones are restricted so they may not affect other zones via a capability-limiting approach. The global zone may administer the non-global zones.[22]
  19. ^ Check the "allow.quotas" option and the "Jails and File Systems" section on the FreeBSD jail man page for details.
  20. ^ Available since TL 02.[33]

出典[編集]

  1. ^ Hogg, Scott (2014年5月26日). “Software Containers: Used More Frequently than Most Realize”. Network World, Inc. http://www.networkworld.com/article/2226996/cisco-subnet/software-containers--used-more-frequently-than-most-realize.html 2015年7月9日閲覧. "There are many other OS-level virtualization systems such as: Linux OpenVZ, Linux-VServer, FreeBSD Jails, AIX Workload Partitions (WPARs), HP-UX Containers (SRP), Solaris Containers, among others." 
  2. ^ Rami, Rosen. “Namespaces and Cgroups, the basis of Linux Containers”. http://www.netdevconf.org/1.1/proceedings/slides/rosen-namespaces-cgroups-lxc.pdf 2016年8月18日閲覧。 
  3. ^ 3.5. Limiting your program's environment freebsd.org.
  4. ^ “Docker drops LXC as default execution environment”. InfoQ. http://www.infoq.com/news/2014/03/docker_0_9 
  5. ^ “Docker comes to FreeBSD”. (2015年7月9日). https://www.freebsdnews.com/2015/07/09/docker-freebsd/ 
  6. ^ “Get started with Docker for Windows”. Docker. (2021年9月10日). https://docs.docker.com/docker-for-windows/ 
  7. ^ “Get started with Docker Desktop for Mac”. (2019年12月6日). https://docs.docker.com/docker-for-mac/ 
  8. ^ “Paper - Linux-VServer”. http://linux-vserver.org/Paper#Secure_Capabilities 
  9. ^ a b Graber, Stéphane (2014年1月1日). “LXC 1.0: Security features [6/10”]. https://www.stgraber.org/2014/01/01/lxc-1-0-security-features/ 2014年2月12日閲覧. "LXC now has support for user namespaces. [...] 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. ^ Sylabs Brings Singularity Containers into Commercial HPC | TOP500 Supercomputer Sites www.top500.org.
  11. ^ “Redirecting…”. (2018年3月14日). https://www.sylabs.io/2018/03/sif-containing-your-containers/ 
  12. ^ Kurtzer, Gregory M.; Sochat, Vanessa; Bauer, Michael W. (May 11, 2017). “Singularity: Scientific containers for mobility of compute”. PLOS ONE 12 (5): e0177459. Bibcode2017PLoSO..1277459K. doi:10.1371/journal.pone.0177459. PMC 5426675. PMID 28494014. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5426675/. 
  13. ^ Bronnikov, Sergey. “Comparison on OpenVZ wiki page”. OpenVZ. https://wiki.openvz.org/Comparison 2018年12月28日閲覧。 
  14. ^ “I/O priorities for containers”. OpenVZ Virtuozzo Containers Wiki. http://wiki.openvz.org/I/O_priorities_for_VE 
  15. ^ “Docker inside CT”. https://openvz.org/Docker_inside_CT 
  16. ^ “Container”. OpenVZ Virtuozzo Containers Wiki. http://wiki.openvz.org/Container 
  17. ^ “Initial public prerelease of Virtuozzo (named ASPcomplete at that time)”. http://www.paul.sladen.org/vserver/aspcomplete/2000-08-25/ve-0.4.2-for-2.4.0-test6.diff.gz 
  18. ^ “Parallels Virtuozzo Now Provides Native Support for Docker”. http://www.odin.com/news/pr/release/article/parallels-virtuozzo-now-provides-native-support-for-docker/ 
  19. ^ Pijewski, Bill. “Our ZFS I/O Throttle”. http://dtrace.org/blogs/wdp/2011/03/our-zfs-io-throttle/ 
  20. ^ Network Virtualization and Resource Control (Crossbow) FAQ Archived 2008-06-01 at the Wayback Machine.
  21. ^ “Managing Network Virtualization and Network Resources in Oracle® Solaris 11.2”. https://docs.oracle.com/cd/E36784_01/html/E36813/index.html 
  22. ^ Oracle Solaris 11.1 Administration, Oracle Solaris Zones, Oracle Solaris 10 Zones and Resource Management E29024.pdf, pp. 356–360. Available within an archive.
  23. ^ “Contain your enthusiasm - Part Two: Jails, Zones, OpenVZ, and LXC”. http://www.cybera.ca/news-and-events/tech-radar/contain-your-enthusiasm-part-two-jails-zones-openvz-and-lxc/. "Jails were first introduced in FreeBSD 4.0 in 2000" 
  24. ^ “Hierarchical_Resource_Limits - FreeBSD Wiki”. Wiki.freebsd.org. (2012年10月27日). http://wiki.freebsd.org/Hierarchical_Resource_Limits 2014年1月15日閲覧。 
  25. ^ “Implementing a Clonable Network Stack in the FreeBSD Kernel”. usenix.org. (2003年6月13日). http://static.usenix.org/publications/library/proceedings/usenix03/tech/freenix03/full_papers/zec/zec.pdf 
  26. ^ “VPS for FreeBSD”. http://www.7he.at/freebsd/vps/ 2016年2月20日閲覧。 
  27. ^ “[Announcement VPS // OS Virtualization // alpha release”]. https://forums.freebsd.org/threads/34284/ 2016年2月20日閲覧。 
  28. ^ “3.5. Limiting your program's environment”. Freebsd.org. http://www.freebsd.org/doc/en/books/developers-handbook/secure-chroot.html 2014年1月15日閲覧。 
  29. ^ Matthew Dillon (2006年). “sys/vkernel.h”. DragonFly BSD. http://bxr.su/d/sys/sys/vkernel.h 
  30. ^ a b “vkd(4) — Virtual Kernel Disc”. DragonFly BSD. http://mdoc.su/d/vkd.4. ""treats the disk image as copy-on-write."" 
  31. ^ a b Sascha Wildner (2007年1月8日). “vkernel, vcd, vkd, vke — virtual kernel architecture”. DragonFly Miscellaneous Information Manual (DragonFly BSD). http://bxr.su/d/share/man/man7/vkernel.7 
  32. ^ “vke(4) — Virtual Kernel Ethernet”. DragonFly BSD. http://mdoc.su/d/vke.4 
  33. ^ “IBM Fix pack information for: WPAR Network Isolation - United States”. ibm.com. (2011年7月21日). http://www-01.ibm.com/support/docview.wss?uid=isg1fixinfo109461 
  34. ^ “Live Application Mobility in AIX 6.1”. (2008年6月3日). http://www.ibm.com/developerworks/aix/library/au-aix61mobility/index.html 
  35. ^ a b c d “systemd-nspawn”. https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html#--property= 
  36. ^ a b c d “2.3. Modifying Control Groups Red Hat Enterprise Linux 7”. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/resource_management_guide/sec-modifying_control_groups 
  37. ^ Polvi, Alex. “CoreOS is building a container runtime, rkt”. オリジナルの2019年4月1日時点におけるアーカイブ。. https://web.archive.org/web/20190401013449/https://coreos.com/blog/rocket.html 2019年3月12日閲覧。 
  38. ^ “LXD”. https://linuxcontainers.org/lxd/ 2021年2月11日閲覧。 
  39. ^ Rootless containers with Podman and fuse-overlayfs, CERN Workshop, 2019-06-04
  40. ^ “Overview — Charliecloud 0.25 documentation”. https://hpc.github.io/charliecloud/ 2020年10月4日閲覧。 
  41. ^ Home - katacontainers.io.
  42. ^ Bottlerocket is a Linux-based operating system purpose-built to run containers