What do I need to create VM on top of seL4 using
CAmkES? Also, I want seL4 to run as hypervisor.
In order to compile our CAmkES VM projects you will need to additionally install the host
dependencies for CAmkES (
https://docs.sel4.systems/HostDependencies.html - under
'CAmkES Build Dependencies'). As you've identified, we have two resources
regarding how to setup a CAmkES VM project (the vm-examples README & tutorial). You
can follow the build instructions described in either resource to build an example system
for getting started.
You can boot the tutorial on an x86 hardware platform
with a multiboot boot loader, or use the QEMU simulator. Note if you are using QEMU it is
important to ensure that your host machine has VT-x support and KVM installed. You also
need to ensure you have enabled nested virtulisation with KVM guests as described here.
In order to run the CAmkES VM you can either boot the images on hardware or within a
emulated environment. If running on hardware, this would usually involve making the images
available on a hard drive or through a network such that the multiboot compliant
bootloader (e.g grub) can access them. This greatly varies depending on your hardware
setup of course. I generally recommend using qemu if you want quickly run and test the VM
images. Expanding on the note about QEMU, our x86 VMM relies on using hardware
virtualization support (VT-x) to run. Thus your host machine needs to have VT-x
enabled/supported (which can usually be determined by cat-ing your
'/proc/cpuinfo' and grep-ing for the 'vmx' flag). In addition you need
to have KVM installed and nested virtualization enabled (since we are running our VMM in a
virtualized environment,
https://wiki.archlinux.org/index.php/KVM#Nested_virtualization
has instructions for enabling),
As shown in the VM tutorial (
https://docs.sel4.systems/Tutorials/camkes-vm-linux.html),
there's an example command to run the CAmkES VM:
sudo ./simulate --machine q35,accel=kvm,kernel-irqchip=split --mem-size 2G
--extra-cpu-opts "+vmx" --extra-qemu-args="-enable-kvm -device
intel-iommu,intremap=off -net nic,model=e1000 -net tap,script=no,ifname=tap0"
Or if running the images built in the camkes-vm-examples project (since this doesn't
generate a simulate script):
qemu-system-x86_64 -machine q35,accel=kvm,kernel-irqchip=split -cpu
Nehalem,+vme,+pdpe1gb,-xsave,-xsaveopt,-xsavec,-fsgsbase,-invpcid,enforce,+vmx -nographic
-serial mon:stdio -m size=2G -enable-kvm -device intel-iommu,intremap=off -net
nic,model=e1000 -net tap,script=no,ifname=tap0 -kernel images/kernel-x86_64-pc99 -initrd
images/capdl-loader-image-x86_64-pc99
Hope this answers your questions.