-1

https://en.wikipedia.org/wiki/Hypervisor#Classification says QEMU is type 2 hypervisor, and KVM can be both type 1 and 2 hypervisor:

The distinction between these two types is not always clear. For instance, Linux's Kernel-based Virtual Machine (KVM) and FreeBSD's bhyve are kernel modules[6] that effectively convert the host operating system to a type-1 hypervisor.[7] At the same time, since Linux distributions and FreeBSD are still general-purpose operating systems, with applications competing with each other for VM resources, KVM and bhyve can also be categorized as type-2 hypervisors.

How is "Linux distributions and FreeBSD are still general-purpose operating systems, with applications competing with each other for VM resources" the reason for KVM to be a type 2 hypervisor?

https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine says

By itself, KVM does not perform any emulation. Instead, it exposes the /dev/kvm interface, which a userspace host can then use to:

  • Set up the guest VM's address space. The host must also supply a firmware image (usually a custom BIOS when emulating PCs) that the guest can use to bootstrap into its main OS.
  • Feed the guest simulated I/O.
  • Map the guest's video display back onto the system host.

On Linux, QEMU versions 0.10.1 and later is one such userspace host. QEMU uses KVM when available to virtualize guests at near-native speeds, but otherwise falls back to software-only emulation.

If "KVM does not perform any emulation", can KVM be a hypervisor

A hypervisor or virtual machine monitor (VMM) is computer software, firmware or hardware that creates and runs virtual machines.

?

Can KVM work as a hypervisor without another hypervisor like QEMU?

Can libvirt also work directly with KVM, without QEMU?

  • 1
    lwn.net/Articles/658511 – A.B Mar 29 at 17:48
  • The Type 1/Type 2 distinction dates back to the 1970s, and in particular was created with such computers in mind, and doesn't make as much sense today as a practical distinction. – Michael Hampton Mar 30 at 2:08
3

How is "Linux distributions and FreeBSD are still general-purpose operating systems, with applications competing with each other for VM resources" the reason for KVM to be a type 2 hypervisor?

The strict interpretation of type 1/type 2 hypervisors is that

  • type 1 hypervisors run alone, and any user-level applications run inside a guest operating system managed by the hypervisor;
  • type 2 hypervisors run on top of a host operating system, which can continue to be used alongside whatever guests are managed by the hypervisor.

The distinction isn’t so clear-cut in practice. For example, Xen, which is widely thought of as a type 1 hypervisor, still needs the help of a “Dom0” Linux guest to manage the system’s resources; so it’s not entirely autonomous on bare metal.

Likewise, KVM can be considered a type 2 hypervisor because it runs on top of a host operating system, the Linux kernel, and that host operating system can run other processes alongside whatever VMs are managed by KVM.

If "KVM does not perform any emulation", can KVM be a hypervisor?

Yes, hypervisors don’t imply emulation.

Can KVM work as a hypervisor without another hypervisor like QEMU?

Yes, see this LWN article for an example.

Can libvirt also work directly with KVM, without QEMU?

No, it only supports KVM with QEMU.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.