Professional Documents
Culture Documents
View license
176
stars
33
forks
Star Notifications
master
Go to file
chp-io … on 15 Jan
View code
Description
warning: MicroV is currently a work in progress. If you need support now,
please see the
Mono branch until MicroV is more complete which is expected to be some time Q1 of 2022.
https://github.com/Bareflank/microv 1/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
Advantages:
Unlike existing hypervisors, MicroV's design has some unique advantages including:
https://github.com/Bareflank/microv 2/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
https://github.com/Bareflank/microv 3/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
Virtual Device Support: Hypervisors like KVM manage all physical devices
in Ring 0 of
the host (the most privileged code on the system) using the
Linux kernel. This is one
way in which Xen is more deprivileged than KVM.
Unlike KVM which runs device drivers
in Ring 0 of the host, Xen runs device
drivers in Ring 0 of the guest (specifically in Dom
0). MicroV aims to
take a similar approach to Xen, keeping the code in the host as small
as
possible, and instead, delegating the guest operating system to manage the
physical
devices it is given. All virtual device backend drivers run in Ring
0 or Ring 3 of the root
VM, which is the main virtual machine on the
system.
https://github.com/Bareflank/microv 4/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
Early Boot and Late Launch Support: Xen, KVM and VirtualBox support
early boot (i.e.,
the hypervisor starts first during boot) or late launch
(i.e., the operating system starts
first, and then the hypervisor starts).
None of these hypervisors support both.
Disadvantages:
No design is without its disadvantages:
https://github.com/Bareflank/microv 5/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
VM DoS Attacks:
Since the main operating system is responsible for scheduling micro
VMs for
execution, it is possible that an attack in this operating system could
prevent
the micro VMs from executing (i.e., DoS attack). For most
applications, this type of
attack is a non-issue as isolation is more
important than resilience against DoS attacks.
With that said, there is no
reason why a micro VM could not be in charge of scheduling
VMs with its own
scheduling and power management software (just like it would be
possible to
run all of the tool stack software in a dedicated micro VM as well). Like
Xen,
MicroV is designed to ensure these facilities are not dependent on the
main operating
README.md
system. The upstream project simply defaults to this type of
configuration as its the
larger, more prevalent use case. And keep in mind
that there is always a tradeoff.
Although the upstream approach is vulnerable
to DoS attacks, implementing your own
scheduler and power management software
is no easy task, and should be limited to
specific use cases (unless
performance and battery life is not important).
Quick start
TBD
Demo
TBD
Build Requirements
Currently, MicroV only supports the Clang/LLVM 10+ compiler. This, however, ensures that
MicroV can be natively compiled on Windows including support for cross-compiling.
Support for other C++20 compilers can be added if needed, just let us know if that is
something you need.
Windows
https://github.com/Bareflank/microv 6/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
To compile the BSL on Windows, you must first disable UEFI SecureBoot and enable test
signing mode. Note that this might require you to reinstall Windows (you have been
warned). This can be done from a command prompt with admin privileges:
<reboot>
Visual Studio is needed as it contains Windows specific libraries that are needed during
compilation. Instead of using the Clang/LLVM project that natively ships with Visual Studio,
we use the standard Clang/LLVM binaries provided by the LLVM project which ensures we
get all of the tools including LLD, Clang Tidy and Clang Format. Also note that you must put
Ninja somewhere
in your path (we usually drop into CMake's bin folder). Finally, make sure
you follow all of the instructions when installing the WDK. These instructions change
frequently, and each step must be installed correctly and in the order provided by the
instructions. Skipping a step, or installing a package in the wrong order will result in a WDK
installation that doesn't work.
To compile the BSL, we are going to use Bash. There are many ways to start Bash including
opening a CMD prompt and typing "bash". Once running bash, make sure you add the
following to your PATH:
MSBuild
devcon
certmgr
For example, in your .bashrc, you might add the following (depending on where Visual
Studio put these files):
https://github.com/Bareflank/microv 7/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
cmake ..
ninja info
ninja
Ubuntu Linux
To compile the BSL on Ubuntu (20.04 or higher) you must first install the following
dependencies:
cmake ..
make info
make
UEFI
TBD
Usage Instructions
MicroV is designed to use existing KVM userspace software to execute guest virtual
machines from the root VM. To execute our integration tests that leverage the KVM API, do
the following:
First, you need to place your current OS into a VM called the root VM. This is done by
hoisting your current OS into a VM (often times called a VMX rootkit, but in our case, this is
defensive, not offensive). To do this run the following:
make loader_quick
make start
You can run the following to verify that your OS is not in the root VM:
make dump
https://github.com/Bareflank/microv 8/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
___ __ _ _
==================================================================
To be able to run KVM APIs, you must load the shim driver, which acts like KVM. To do this,
run:
make shim_quick
You can only run the shim driver AFTER MicroV has started. Otherwise you will get a failure.
If you look at dmesg , you will see that the shim driver will have complained that MicroV's is
not running, which likely means that you need to rerun make start .
If make start fails, it means that Bareflank's loader is not running, which is why we can
make loader_quick .
From here, you can run whatever integration test you want. For example:
make kvm_create_vm
make kvm_create_vcpu
You can see the results of the integration test by either looking at the resulting console
output, or looking at what MicroV's debug buffer contains by using make dump .
You can also run MicroV's integration tests as well. These are tests designed to talk directly
to MicroV instead of using the KVM APIs. For example:
https://github.com/Bareflank/microv 9/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
make mv_handle_op_open_handle
make mv_handle_op_close_handle
You do not need the shim driver to run these integration tests, and yes, you can use the
MicroV ABIs to write your own VMM without the need for the KVM shim, or any of the KVM
APIs if you would like. This removes the need for the additional kernel calls and overhead of
the shim driver, but requires that you write your own VMM software as things like QEMU
and rust-vmm will not work without modifications to talk directly to MicroV instead of to
MicroV via the KVM APIs.
Resources
chat on Slack
MicroV provides a ton of useful resources to learn how to use the library including:
Documentation: https://bareflank.github.io/microv/
Unit Tests: https://github.com/Bareflank/microv/tree/master/test
If you have any questions, bugs, or feature requests, please feel free to ask on any of the
following:
Slack: https://bareflank.herokuapp.com/
Issue Tracker: https://github.com/Bareflank/microv/issues
Testing
GitHub Actions success
codecov 100%
MicroV leverages the following tools to ensure the highest possible code quality. Each pull
request undergoes the following rigorous testing and review:
https://github.com/Bareflank/microv 10/11
2022/5/31 21:34 GitHub - Bareflank/MicroV: A micro hypervisor for running micro VMs
Documentation: Doxygen
Serial Instructions
On Windows, serial output might not work, and on some systems (e.g. Intel NUC),
the
default Windows serial device may prevent Bareflank from starting at all.
If this is the case,
disable the default serial device using the following:
License
The Bareflank Hypervisor is licensed under the MIT License.
Releases
1
tags
Packages
No packages published
Contributors 7
Languages
C++ 63.1%
C 24.7%
Assembly 7.3%
CMake 3.9%
Makefile 0.5%
Python 0.5%
https://github.com/Bareflank/microv 11/11