Xen or KVM: Open-source hypervisors compared

Author: HOSTTEST Editorial   | 13 Jul 2022

xen-kvm-picWhen it comes to open-source virtualisation and the question of whether to use KVM or Xen as the hypervisor, the answer may seem obvious at first glance. KVM appears to have won the race that was long a neck‑and‑neck contest — especially since it became an integral part of Red Hat Linux. However, the matter is not that clear‑cut: Xen should not be dismissed in open‑source virtualisation, as it does offer certain advantages. We will examine the topic in more detail.

The rise of KVM

It is fair to say that KVM has established itself in the market as the hypervisor for open‑source virtualisation. One must also acknowledge the claim that KVM is now the de facto standard. However, it is plainly not true that Xen no longer plays any role or offers no deployment scenarios or advantages.

Key differences and potential advantages of Xen

One of Xen's fundamental differences is that it is clearly and indisputably a Type‑1 (bare‑metal) hypervisor. With KVM this is far less clear — experts even disagree about which type of hypervisor KVM actually is. We've already covered more on hypervisor types and the fundamental differences in server virtualisation in our guide.

That single, fundamental difference already has considerable consequences. As a Type‑1 hypervisor, Xen uses paravirtualisation to allocate server resources much more efficiently to guest systems; device drivers installed in the VM gain direct access to the hardware. This — unlike other architectures — results in significantly better performance. Nowadays, with vast server resources available, this may seem less important (in the early 2000s, at Xen's heyday, server performance was very different), but better performance and more efficient use of server resources in open‑source virtualisation can never be a disadvantage.

You can also read about the difference to container virtualisation, such as LXC vs KVM.

How this affects real‑world performance can only be tested on an individual system: in theory performance is better, but whether you will see the same on your own server needs to be tested.

More on KVM servers and some providers of server solutions:

Comparison of KVM VPS providers
Comparison of KVM cloud server providers

Additionally: if a virtual machine runs amok under KVM, it almost inevitably affects the entire server and usually also all other VMs, because the host kernel always sees the whole hardware. With Xen this is simply impossible, as the hypervisor manages the hardware. Problems with a VM always remain confined to that particular VM. Depending on the use case for your chosen open‑source virtualisation, this can be an important point in individual cases.

When "passthrough" of the server hardware to the VMs is used, Xen is somewhat more thorough; however the advantage is no longer so significant, as both actually handle it quite well. You will hardly notice any significant differences between the two systems on this point for open‑source virtualisation.

More on Xen servers and some providers of server solutions:

Comparison of Xen VPS providers

KVM vs Xen: Conclusion

KVM is the de facto standard, no question. Xen nevertheless represents a good and in many cases advantageous alternative; it is equally future‑proof and can now be installed and set up with almost as little effort. Whether Xen's potential advantages will affect your own server can only be determined on a case‑by‑case basis.

You should definitely test it — and certainly consider Xen as a valid alternative to KVM.

 

Our article is based on our own experience and research as well as information from external sources.

Sources & further reading on the topic:
https://www.linux-kvm.org/page/Main_Page (Official KVM community wiki)
https://www.redhat.com/de/topics/virtualization/what-is-KVM (Information from the owner of the KVM developer)
https://xenproject.org/ (Official Xen project website)
https://www.linux-magazin.de/ausgaben/2017/12/xen/ (Article about Xen in Linux Magazin)

Image credit:
Gerd Altmann on Pixabay

 

Write a comment


More web hosts


More interesting articles