KVM Forum 2024

The KVM Backend for VirtualBox
2024-09-23 , Hall A+B

In this presentation, we will share our experience of developing the KVM backend for VirtualBox. It allows VirtualBox to use KVM as a hypervisor and makes the VirtualBox third-party kernel modules unnecessary.

VirtualBox is a vast C++ codebase that implements a full virtualization solution in a cathedral style. It consists of a tightly integrated kernel and userspace part with lots of flexibility to execute code in kernel or userspace depending on the situation. Both components are highly portable across operating systems. This unique architecture predates KVM and is very different from how Qemu interacts with KVM.

Because shipping a third-party hypervisor is more and more problematic on Windows and MacOS, VirtualBox has introduced a new internal abstraction, the Native Execution Manager (NEM). NEM allows using the native virtualization API of the operating system. There are unfinished and experimental NEM backends in the VirtualBox code base for Hyper-V, the Apple Hypervisor Framework and KVM.

Starting from the incomplete KVM backend already present in the VirtualBox code base, we gradually turned it into a fully-featured and stable backend ready for day-to-day use. We will discuss the main challenges we faced in this journey. We will mostly focus on the following two topics:

  • Integrating VirtualBox with KVM’s IRQCHIP abstraction to leverage advanced interrupt virtualization features (something that vanilla VirtualBox cannot do),
  • Enabling nested virtualization for VirtualBox and the challenges we faced around the KVM API.

As we previously worked extensively on custom hypervisors, we also want to share our constructive thoughts on the KVM API, highlighting its successes, complexities and maybe even starting a discussion on how to simplify it.

See also: Slides (3.0 MB)

Julian Stecklina is a seasoned system software developer with experience in operating systems, hypervisors and low-level system software in general. His career began around 2009, with a particular focus on microkernel-based operating systems and virtualization technologies. For the last 15 years, he has worked on all facets of virtualization-based system. Currently, he is Head of Virtualization Technology at Cyberus Technology GmbH. Besides system software, he enjoys honing his Nix skills. In his spare time, he likes to hike, run and read.

Software Engineer at Cyberus Technology GmbH, Dresden, Saxony, Germany