Installing SeKVM is similar to installing vanilla KVM on Arm. Since KVM/ARM cannot be installed as a dedicated kernel module, you have to compile the entire kernel to install it. This document describes how to install SeKVM on a Cloudlab m400 Arm server.
By default, m400 on cloudlab only provides 16GB disk mounted at /root which is infeasible for compiling the kernel and running a VM. You have to enable the internal SSD by editing the profile. You may refer to the cloudlab manual and the e6998-vct-m400
profile.
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev
sudo apt install device-tree-compiler
sudo apt install u-boot-tools
You can use the qemu source code in the artifact repo.
Note that source code is only for running VMs on SeKVM. You should use unmodified QEMU for running VMs on vanilla KVM.
- Get the SeKVM source code from the artifact repo and compile the source code
cd linux
make sekvm_defconfig && make -j8 && sudo make install && sudo make modules_install
- Backup current kernel, initrd and boot script
cd /boot
cp uImage uImage.bak
cp uInitrd uInitrd.bak
cp boot.scr boot.scr.bak
- Make u-boot image and install the image
cd linux
mkimage -A arm -O linux -C none -T kernel -a 0x00080000 -e 0x00080000 -n Linux
-d arch/arm64/boot/Image arch/arm64/boot/uImage
cp arch/arm64/boot/uImage /boot/uImage
- Save the following boot script to boot.script. The firmware on m400 only exposes a limited GICv2 interface, so we need to patch the boot script as a workaround.
setenv bootargs "console=ttyS0,${baudrate}n8r ro root=/dev/sda1 irqchip.gicv2_force_probe=1"
setenv verify no
load scsi 0 ${kernel_addr_r} uImage
load scsi 0 ${ramdisk_addr_r} uInitrd
bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
- Make the boot script image
mkimage -A arm -T script -C none -n "SeKVM Boot Script" \
-d boot.script boot.scr
cp boot.scr /boot/.
- Install the initrd
mkimage -A arm -T ramdisk -C none -n uInitrd -d /boot/initrd.img-4.18.0+ /boot/uInitrd
- Reboot the machine
You can use the script in the artifact repo to run the VM. Since the script is assumed to be running on the provided cloudlab image, you may change the path of the QEMU to where you installed your QEMU.