When you install Linux and want to start a KVM VM, you may find that you need to install different software. There are several ways to start the VM:

  • virsh start
  • KVM command
  • Qemu command
  • Qemu – KVM command
  • Qemu – system – x86_64 command


First, let’s look at QEMU, in which the keyword EMU, the full name of emulator, emulator, is used. Therefore, qEMU is a completely virtualization mode.

Qemu simulates the CPU to the GuestOS, as well as other hardware. GuestOS believes that it is dealing directly with hardware, but in fact it is dealing with simulated hardware from Qemu, which translates these instructions to the real hardware. Performance is poor because all instructions have to pass through Qemu.

Full virtualization is very slow, so you need to use hardware assisted virtualization technology Intel-VT, AMD-V, so you need to CPU hardware to enable this flag bit, generally set in the BIOS. Check whether the function is enabled.

The command is available for Intel CPU
grep "vmx" /proc/cpuinfo 

The command is available for AMD CPUS
grep "svm" /proc/cpuinfo 
Copy the code

After the flag bit is started, GuestOS CPU commands run directly through the KVM without Qemu translation, greatly increasing the speed.

Therefore, KVM needs to have a module in the kernel to set whether the CPU is being used by the Guest OS or the Host OS.


Kernel-based Virtual Machine (KVM) is a virtualization infrastructure used in the Linux Kernel to turn the Linux Kernel into a Virtual Machine monitor.

KVM provides an abstract device that does not emulate a processor. It opens the /dev/KVM interface for use by hosts in user mode.


Qemu-kvm (qemU-system-xxx) qemU-KVM (qemu-system-xxx) qEMU-KVM (qemu-system-xxx)

After qEMU and KVM are integrated, CPU performance problems are solved. In addition, QEMU also simulates other hardware, such as Network and Disk, and full virtualization also affects the performance of these devices.

So QEMU takes a paravirtualization or virtualization-like approach and lets Guest OS load special drivers to do this.

For example, the virtio_net needs to be loaded to the network, the virtio_BLk needs to be loaded to the storage, and the Guest needs to install the paravirturalization drivers. GuestOS knows that it is a VM, so data is sent to the paravirturalization devices through special processing methods such as queuing, caching, and batch processing. Finally sent to real hardware, somewhat improved performance.


Qemu, qemu-KVM, or qemu-system-xxx are rarely used. Virsh is a libvirt tool. Libvirt is the most widely used tool and API for managing KVM virtual machines.

Libvirt consists of a server and a client. Libvirtd is a daemon process that can be invoked by a local virsh or a remote virsh. Virsh is a client.

Libvirtd invokes qemu-KVM to operate VMS. Qemu-kvm invokes the KERNEL module of KVM to perform CPU virtualization

Then the whole correlation became clear.


  • Am I a vm kernel I am confused? !
  • Qemu, KVM, and Virsh are confused
  • Kernel-based Virtual Machines -Wikipedia