Skip to content

Playing with hypervisor, running guest machines inside a host machine being emulated

Notifications You must be signed in to change notification settings

edubart/hypervisor-playground

Repository files navigation

Hypervisor playground

Experiments with Cartesi Machine, QEMU and RISC-V Hypervisor extension.

Make sure you have QEMU >= 8.1+, and latest Cartesi Machine.

Compile rootfs

Make sure you have Docker with RISC-V 64 support and our patched genext2fs available first.

# Compile host rootfs and guest rootfs
make all

Host Shell

Host shell for running guest machines manually.

# Cartesi Machine as host emulator
make host-run HOST_EMU=cemu
# QEMU as host emulator
make host-run HOST_EMU=qemu

Guest Shell

Guest shell for testing a guest machine.

# Cartesi Machine as host emulator, LKVM as guest emulator
make guest-run HOST_EMU=cemu GUEST_EMU=lkvm
# Cartesi Machine as host emulator, QEMU as guest emulator
make guest-run HOST_EMU=cemu GUEST_EMU=qemu
# QEMU as host emulator, LKVM as guest emulator
make guest-run HOST_EMU=qemu GUEST_EMU=lkvm
# QEMU as host emulator, QEMU as guest emulator
make guest-run HOST_EMU=qemu GUEST_EMU=qemu

By default HOST_EMU is cemu and GUEST_EMU is lkvm.

Guest Commands

You can test guest commands by setting GUEST_CMD:

# Cartesi Machine as host emulator, LKVM as guest emulator
make guest-run HOST_EMU=cemu GUEST_EMU=lkvm GUEST_CMD="echo HELLO FROM GUEST"
# Cartesi Machine as host emulator, QEMU as guest emulator
make guest-run HOST_EMU=cemu GUEST_EMU=qemu GUEST_CMD="echo HELLO FROM GUEST"
# QEMU as host emulator, LKVM as guest emulator
make guest-run HOST_EMU=qemu GUEST_EMU=lkvm GUEST_CMD="echo HELLO FROM GUEST"
# QEMU as host emulator, QEMU as guest emulator
make guest-run HOST_EMU=qemu GUEST_EMU=qemu GUEST_CMD="echo HELLO FROM GUEST"

Tests

# ping host machine test
make guest-ping-test
# intensive stress tests (should take hours)
make guest-stress-test

You can use the same HOST_EMU and GUEST_EMU options.

References for interesting stress tests with stress-ng:

About

Playing with hypervisor, running guest machines inside a host machine being emulated

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published