Virtualization

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. Please help out by expanding it - how to get started.
Resources
This article has some todo items:
  • Reword.
  • Elaborate.
  • Explain guest facilities more.
  • Copy any relevant & still current content from old VPS article.
  • Add more packages.
  • Etc.

Virtualization is the concept and technique that permits running software in an environment separate from a computer operating system.

The operating system actually running on the hardware is referred to as the host. On this host resides a hypervisor (aka virtual machine manager), which runs virtual machines containing guest software.

Hardware feature

Many modern computer architectures include support for virtualization at the hardware level.

For the AMD64 and x86 computer architectures, hardware virtualization is supported via AMD's AMD-V (svm) or Intel's Vt-x (vmx) virtualization extensions. The virtualization extensions must be supported by the processor and enabled in the system's firmware (typically the motherboard's firmware menu) in order to be accessible by guest operating system(s).

System firmware

Accessing the appropriate menu for enabling virtualization support in the system firmware is beyond the scope of this article. Each manufacture has a sightly different navigation and title for the setting. Generally, there is a toggle for "Virtualization" under the CPU settings of the motherboard firmware.

Once enabled at the firmware level, validate support is available in the kernel.

Kernel support

AMD CPUs

To inspect hardware for virtualization support issue the following command:

user $grep --color -E "svm" /proc/cpuinfo

The running kernel supports hardware virtualization when "svm" is visible in the output.

Intel CPUs

Hardware virtualization support for Intel based systems can be tested by running the following command:

user $grep --color -E "vmx" /proc/cpuinfo

The running kernel supports hardware virtualization when "vmx" is visible in the output.

Available software

Hypervisors

Hypervisors Virtualization type Description Gentoo package name
qemu full[1]/software-emulation QEMU's own Tiny Code Generator. This is the default. More frequently denoted as qemu and not qemu/tcg so often. app-emulation/qemu
VMware ESXi native VMware, Inc. sells a variety of closed-source hypervisors. Type-1 virtualization. Also uses libvirt driver. app-emulation/open-vm-tools
Xen native, paravirtualization[2] Native, bare-metal, hypervisor that allows multiple distinct virtual machines (referred to as domains) to share a single physical machine. Type-1 Virtualization; supports Microsoft Windows as a guest OS. Also can do Type-2 Virtualization which does not support Microsoft Windows as a guest OS[3] app-emulation/xen
VirtualBox paravirtualization[4] Cross-platform virtualization software that allows users to run guest operating systems inside a Virtualbox host operating system. app-emulation/virtualbox
Bhyve (FreeBSD) paravirtualization[5] bhyve, the "BSD hypervisor" is a hypervisor/virtual machine manager available on FreeBSD, macOS, and Illumos.
User-Mode Linux (UML) paravirtualization[6] The UML driver for libvirt allows use and management of paravirtualized guests built for User Mode Linux. UML is a software-assist, Type-2 virtualization. incorporated into mainstream Linux repository in 2016

Wikipedia has more on virtualization this over at Libvirt#Supported Hypervisors.

Containers

Containers provide isolated user space instances.

Containers

All containers are OS-level[7] virtualization type.

Virtualizer Description Gentoo package name
Buildah Tool that facilitates building OCI images app-containers/buildah
Docker Container virtualization environment which can establish development or runtime environments without modifying the environment of the base operating system. app-containers/docker
LXC (Linux Containers) Virtualization system making use of the cgroups feature of the Linux kernel. app-containers/lxc
LXD Next generation system container manager. app-containers/lxd
Podman Daemonless container engine for developing, managing, and running OCI Containers on linux. app-containers/podman
systemd-nspawn[8] systemd nspawn sys-apps/gentoo-systemd-integration

Orchestration

Container orchestration concerns the details of managing multiple Linux containers. This management layer spins up and spins down individual containers. Examples of container managers are Docker and Mesos, although others exist. There is also container orchestration where K8/docker swarm and related software compete for similar management functions.

GUIs

Name Package Description
GNOME Boxes gnome-extra/gnome-boxes Simple GNOME application to access remote or virtual systems.
virt-manager app-emulation/virt-manager Graphical tool for administering virtual machines.
VirtualBox app-emulation/virtualbox A GUI is included by default with VirtualBox. The headless USE flag is can be enabled to remove GUI support.

Guest facilities

Most virtualization systems provide software to be installed inside the guest operating systems, to provide extra functionality.

These packages are for Gentoo guests running inside virtual machines. See respective hypervisor documentation for tools helping to run other operating systems inside virtual machines.

Name Package Description
VirtualBox app-emulation/virtualbox-guest-additions VirtualBox Guest Additions
VMware app-emulation/open-vm-tools VMware, Inc. sells a variety of closed-source hypervisors.

See also

  • Libvirt — a virtualization management toolkit.
  • Libvirt/QEMU_networking — details the setup of Gentoo networking by Libvirt for use by guest containers and QEMU-based virtual machines.
  • Libvirt/QEMU_guest — covers libvirt and its creation of a virtual machine (VM) for use under the soft-emulation mode QEMU hypervisor Type-2, notably using virsh command.
  • Virt-manager — desktop user interface for management of virtual machines and containers through the libvirt library
  • Virt-manager/QEMU_guest — QEMU creation of a guest (VM or container)
  • QEMU/Linux guest — describes the setup of a Gentoo Linux guest in QEMU using Gentoo bootable media.

External resources

References