Redox as a virtualization platform (host/hypervisor)


#1

Posted this first on the subreddit but I guess this forum is more active. I’m interested in the possibility of using Redox as a (bare-metal, hardware-accelerated virtualization) hypervisor.

Rust is the perfect (only decent?) language to implement this in and the design goals of Redox seem very suited to this task. Some links and brainstorming here, including about (defunct-ish) ports of KVM to SmartOS and FreeBSD:

A few assorted questions:

  • How difficult would it be to port KVM/QEMU to run on Redox?
  • Is there an overview somewhere of Redox’s isolation/compartmentalization/containerization facilities and how do these compare to full virtualization?
  • Any plan to support Linux kernel modules, similar to how FreeBSD does?

I dug up a few GH issues touching on some of these topics, but for the most part they seem inconclusive/out of date:





Redox is innovation
#2

We placed KVM together with its infrastructure (Linux and Qemu) in a VM managed
by our low-complexity Karma VMM. We call a VM that is controlled by the Karma VMM a first-stage VM, and consequently, we call a VM run by KVM a second-stage VM.

Perhaps it would be a better idea to port Karma VMM to Redox rather than porting KVM directly. Karma VMM has a much smaller codebase (3800 SLOC; so 3.8k rather than KVM’s ~40k + QEMU’s ~1 million). Karma was created for L4 / Fiasco.OC, which, if I understand correctly, are likely less different to Redox than Linux is.

At 4k LOC, Karma is also small enough to feasibly rewrite in Rust.

See also the researchers’ earlier paper [PSLW09]: https://www.ruhr-uni-bochum.de/integriertesysteme/emuco/files/peterschild09_vtds_virtual_machines_jailed.pdf

Karma source:


#3

Peter and colleagues [PSLW09] were able to implement secure VMs by adding only 500 lines of code to the Fiasco microkernel, which is an insignificant increase of the TCB.


#4

Some compilation of resources and brainstorming about how to do this type of a project are online here: https://github.com/KVMarx/marx-planning