uhyve - A minimal hypervisor for RustyHermit
uhyve is small hypervisor to boot the library operating systems RustyHermit, which is a unikernel operating system targeting a scalable and predictable runtime behavior for HPC and cloud environments.
Warning: At the moment uhyve grants full host file system access from within the unikernel with the permissions of the user running uhyve. Thus, it should not be used for applications which require isolation from the host system.
An installation of the Rust toolchain is required. Please visit the Rust website and follow the installation instructions. The project can then be installed with the following command:
To check if your system supports virtualization, you can use the following command:
On Linux, uhyve depends on the virtualization solution KVM (Kernel-based Virtual Machine). If the following command gives you some output, you are ready to go!
NOTE: If in case the above steps don't work, make sure to check in your BIOS settings that virtualization is enabled there.
Disclaimer: Currently, uhyve is mainly developed for Linux. The macOS version has not been tested extensively and does not support all features of the Linux version.
Apple's Command Line Tools must be installed. The following terminal command installs these tools without Apple's IDE Xcode:
Additionally, the included hypervisor bases on the Hypervisor Framework depending on OS X Yosemite (10.10) or newer. To verify if your processor is able to support this framework, run the following in your Terminal:
kern.hv_support: 1 indicates virtualization support.
Starting with Big Sur, all processes using the Hypervisor API must have the com.apple.security.hypervisor entitlement and therefore must be signed.
Building from source
To build from source, simply checkout the code and use
Signing uhyve to run on macOS Big Sur
uhyve can be self-signed with the following command.
app.entitlements must have following content:
For further details have a look at Apple's documentation.
Running RustyHermit apps within uhyve
Use the hypervisor to start the unikernel.
uhyve can be configured via environment variables. The following variables are supported.
HERMIT_CPUS: specifies the number of cores the virtual machine may use.
HERMIT_MEM: defines the memory size of the virtual machine. The suffixes M and G can be used to specify a value in megabytes or gigabytes, respectively.
1makes the hypervisor print kernel log messages to the terminal.
HERMIT_GDB_PORT=portactivate a gdb server for the application running inside uhyve. See below
By default, the loader initializes a system with one core and 512 MiB RAM.
Example: the following command starts the demo application in a virtual machine, which has 4 cores and 8GiB memory:
Debugging of RustyHermit apps (unstable)
Basic support of (single-core) applications is already integrated into uhyve.
By specifying variable
HERMIT_GDB_PORT=port, uhyve is working as gdbserver and is waiting on port
port for a connection to a gdb.
For instance, with the following command uhyve is waiting on port
6677 for a connection.
In principle, every gdb-capable IDE should be able to debug RustyHermit applications. (Eclipse, VSCode, ...)
The repository rusty-hermit provides example configuration files to debug a RustyHermit application with Visual Code.
- Uhyve isn't able to pass more than 128 environment variables to the unikernel.
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or #404)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.