VMs should be easy.
Minivirt is a lightweight QEMU manager that provides a Docker-like user experience. The default image is based on Alpine Linux, which is tiny and fast: 50MB compressed disk image, boots to SSH in second(s).
-
Install QEMU and other dependencies.
- MacOS:
brew install qemu socat - Debian:
apt install qemu-kvm qemu-utils qemu-efi-aarch64 socat - Alpine:
apk add py3-pip qemu qemu-system-x86_64 qemu-img socat tar - Arch:
pacman -S python-pip qemu-base socat
- MacOS:
-
Install Minivirt and run a checkup.
pip3 install minivirt miv doctor
-
Pull an image (or build one yourself).
miv remote add default https://f003.backblazeb2.com/file/minivirt miv pull default alpine-{arch} alpine # {arch} is automatically replaced with your architecture. -
Start a VM.
miv run alpine
The miv run command will create an ephemeral VM and open an SSH session into it. When you exit the session, the VM is destroyed.
The actual work of emulating virtual machines is done by QEMU. It runs in many environments, which means we can provide (mostly) the same features everywhere.
Virtual machines run as user processes, no root privileges necessary. The user does however need permissions for hardware virtualization (e.g. access to /dev/kvm on Linux).
It's possible to interact with the VM in three ways:
- Serial console: this is the default for
miv start. - Graphical display: enabled by the
--displayargument. - SSH:
miv runconnects through SSH, using the Vagrant well-known SSH key. Also,miv sshcan shell into a running VM.
The QEMU VM is set up with User Networking, which doesn't interfere with the host's network stack, and the guest SSH port is forwarded to a random port on localhost. You can forward more ports with the --port option.
Minivirt manages images, which are essentially read-only, reusable virtual machine qcow2 disks; and VMs, with their own copy-on-write disk, which uses the image disk as its backing file. See database for details.
The miv doctor command runs a checkup to help with troubleshooting. It checks to see if qemu-system-{arch}, qemu-img, socat and tar are installed, and if /dev/kvm is usable.
For feedback, support, and contributions, visit:
- The Discord server.
- Discussions on GitHub.