Skip to content

A minimalist type 2 hypervisor using Linux Kernel Virtual Machine (KVM)

License

Notifications You must be signed in to change notification settings

sysprog21/kvm-host

Repository files navigation

kvm-host

kvm-host is a minimalist type 2 hypervisor using Linux Kernel-based Virtual Machine (KVM), capable of running Linux kernel partially.

Supported Architecture

  • x86-64
  • Aarch64 (GICv2/GICv3)

Build and Run

Fetch required submodules (only necessary for ARM build):

git submodule update --init --recursive

To compile:

make

Download and build Linux kernel from scratch:

make build/bzImage

(or make build/Image for Arm64 host)

Download and build Busybox for root file system from scratch:

make rootfs

Run Linux guest with kvm-host:

make check

Usage

build/kvm-host -k bzImage [-i initrd] [-d disk-image]

bzImage is the path to linux kernel bzImage. The bzImage file is in a specific format, containing concatenated bootsect.o + setup.o + misc.o + piggy.o. initrd is the path to initial RAM disk image, which is an optional argument. disk-image is the path to disk image which can be mounted as a block device via virtio. For the reference Linux guest, ext4 filesystem is used for disk image.

To exit kvm-host, press "Ctrl-A", release both keys, and then press "x".

License

kvm-host is released under the BSD 2 clause license. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

References