QEMU: Difference between revisions

Jump to navigation Jump to search
rewrite kvm to be hypervisor independent
(run on sentence/grammar)
(rewrite kvm to be hypervisor independent)
*The host operating system does not run well with KVM (e.g. [[Windows 98]] does not run with KVM on most systems)
 
===System emulation withunder KVMa hypervisor===
With KVM, the Linux kernel's API for utilizing CPU native virtualization support, QEMU's system emulation can run operating systems at near native speeds.
 
ALternatively, QEMU can use a hypervisor API provided by the host operating system to run the virtual CPUs (vCPUs), which allows it to run operating systems at near native speed.
When enabled, instead of using TCG to ''emulate'' each vCPU present in the configured machine, QEMU will instead request KVM run the vCPU, greatly increasing the performance of the virtualized system. Most of QEMU's hardware/system emulation still runs in usermode with KVM enabled, however some performance sensitive chipset emulation functionality is by default moved into KVM, helping increase performance further.
 
When a given hypervisor is enabled, instead of using TCG to ''emulate'' each vCPU present in the configured machine, QEMU will instead request KVMthe hypervisor run the vCPU, greatly increasing the performance of the virtualized system. Most of QEMU's hardware/system emulation still runs in usermode with KVM enabled, however some performance sensitive chipset emulation functionality is by default moved into KVM, helping increase performance further.
You can enable KVM by adding <kbd>-accel kvm</kbd> to the startup arguments, or by appending <kbd>,accel=kvm</kbd> to your <kbd>-machine</kbd>/<kbd>-M</kbd> option.
 
Most of QEMU's hardware/system emulation still runs in usermode with a hypervisor enabled. On KVM, chipset emulation functionality is by default moved into the kernel, helping increase performance further.
If installed, you can check if you are ready to enable kvm by checking the command <kbd>kvm-ok</kbd>, or alternatively <kbd>ls /dev/kvm</kbd>.
 
QEMU supports the following hypervisor APIs:
 
{| class="wikitable sortable"
|+ Caption text
|-
! API !! Platforms !! Details
|-
If| installed,KVM you(<kbd>-accel cankvm</kbd>) check|| ifLinux you|| areLinux's readynative tohypervisor enableAPI. kvmYou can check for KVM support by checkingrunning the command <kbd>kvm-ok</kbd>, or alternatively <kbd>ls /dev/kvm</kbd>.
|-
| HAXM (<kbd>-accel haxm</kbd>) || Windows, macOS, FreeBSD, Linux || A deprecated hypervisor layer written by Intel for x86 platforms. Not reccomended for use.
|-
| WHPX (<kbd>-accel whpx</kbd>) || Windows || Windows Hypervisor Platform. Essentially the hypervisor core of Hyper-V abstracted out into an API. This does not run very well.
|-
| GVM/AEHD (<kbd>-accel kvm</kbd>) || Windows || Google-backed port of KVM to Windows, mainly used for the Android Virtual Device emulator, which is based on QEMU. Needs a [https://github.com/qemu-gvm/qemu-gvm fork] of QEMU patched to support it.
|-
| Hypervisor.framework (<kbd>-accel hvf</kbd>) || macOS || macOS specific hypervisor API.
|}
 
Note that you can also use <kbd>-M ...,accel=<hypervisor></kbd> to enable hypervisor support.
 
==Table of contents==

Navigation menu