User:Egberts/Drafts/QEMU

QEMU (Quick EMUlator) is Article description::a generic, open source hardware emulator and virtualization suite.

QEMU is a [Type-2 hypervisor] that runs within user space and performs virtual hardware emulation.

QEMU when used in conjunction with an accelerator becomes a Type-1 hypervisor that runs in kernel space, that allows a user space program access to the hardware virtualization features of various processors. Such accelerator can be KVM (Kernel-based Virtual Machine) or Xen.

If no accelerator is used, QEMU will run entirely in user-space using its built in binary translator TCG (Tiny Code Generator). Using QEMU without an accelerator is relatively inefficient and slow.

QEMU Functional Capabilities

 * Firstly, QEMU is a Type 2 Hypervisor
 * QEMU can be paired with KVM to run VMs at near native speed. This is accomplished by using hardware extensions such as: Intel VT-x or AMD-V.
 * It can then emulate for user-level processes that allow applications compiled for one architecture to run on a different one.
 * Multiple operating modes: User-mode emu, System emu, KVM hosting, and Xen Hosting,
 * QEMU can save and restore the state of VMs with all programs running.
 * QEMU VMs can interface with many types of physical host hardware such as CD-ROM Drives, USB Devices, Audio Interfaces, Hard Disks, Network Cards
 * Virtual Disk Images can be stored as qcow or qcow2 format which only uses as much disk space as the Guest OS is actually using. Therefore, allowing for a large emulated disk to only use a small portion of the host’s disk space. In turn, it also allows for the ability to revert the emulated disk’s contents to a previous state. (Snapshots)
 * It does not depend on graphical output methods on the host system, instead making use of an integrated VNC server to access the screen of the guest OS.
 * QEMU is able to execute multiple virtual CPUs in parallel.

System User/Group
User name qemu is required; Defined by ; evoked by package.

Group name qemu is requried. Defined by ; evoked by package.

Host setup
This section details the fastest paravirtualization (QEMU/KVM) setup for a host that has been installed with Gentoo OS on either x86_64, amd64, or mips CPU hardware platform.

BIOS and UEFI firmware
In order to utilize KVM either Vt-x (vmx) or AMD-V (svm) must be supported by the host processor. Vt-x or AMD-V are Intel and AMD's respective technologies for permitting multiple operating systems to concurrently execute operations on the host processors.

To inspect host hardware for virtualization support, issue the following command:

If KVM support is available, there should be a "kvm" device listed under. This will take effect after the system has booted to a KVM-enabled kernel.

Kernel
Described below are the basic requirements for KVM kernel configuration for the host OS. A more complete and up-to-date list can be found at the [//www.linux-kvm.org/page/Tuning_Kernel KVM Tuning Kernel] page.

Physical CPU Processor Support - Host
If KVM support is not available, insert CONFIG_KVM=y into the and rebuild/reinstall the kernel (and its initramfs image). Come back here after the host gets rebooted.

For the QEMU host, choose one of the two CPU architectures found on its hardware platform:

or

Since we are building the KVM into the kernel (and not as a module), only choose one CPU architecture: Intel or AMD.

Virtual CPU Processor Support - Guest(s)
For a list of supporting CPUs that the guest platform(s) on this host should support, consult the [QEMU use flags] and insert desire target(s) into the USE= string in the portage configuration  file.

Handling Kernel Config at CLI
To set the various kernel configuration settings from the command lines, the shall be used here:

Mandatory kernel configuration options to set:

Useful kernel configuration options to use:

Accelerated networking, required for  USE flag (recommend):

Needed for 802.1d Ethernet bridging:

Intel VT-g (integrated graphics adapter virtualization)
Mediated device passthrough for Intel GPUs (Broadwell and newer) [//forums.gentoo.org/viewtopic-p-8157704.html].

Removal
To remove qemu package, execute: