**Show HN: Mvvmm – A Firecracker-like Mini Virtual Machine Monitor in ~2000 LoC**
The world of virtualization has just gotten a whole lot more interesting with the introduction of MVVMM, a small and lightweight virtual machine monitor that's eerily reminiscent of Amazon Web Services' own Firecracker. Written by an anonymous contributor, this miniature VMM is still in its early stages but promises to be a game-changer for developers looking to experiment with virtualization.
With only around 2000 lines of code, MVVMM is impressively compact while still managing to pack in some essential features. Built on top of the KVM hypervisor, this tiny VMM is perfect for hacking and tweaking – not quite ready for production just yet, but an absolute blast to play with.
To get started with MVVMM, you'll need to set up a few configurations using the following commands. Press `/` and search for each of these settings, then set them to `y`:
- Setup a TAP device and enable NAT
- Create a disk image with a hole, and mount it
- Install Alpine Linux, chroot into minirootfs, and do some setup
- Edit `/etc/inittab` and uncomment the line to enable getty on serial port
- When everything is done, shut down the virtual machine
- And press Ctrl+A Ctrl+C to quit.
You can also set up a sshd and disable serial port for added convenience. With keyboard, mouse, and serial ports disabled, Alpine Linux can boot in as little as 300 milliseconds – lightning-fast! However, it's worth noting that MVVMM doesn't support ACPI (Advanced Configuration and Power Interface), so you'll need to rely on a custom kernel module to handle poweroff.
The guest-module repository contains the source code for this custom kernel module, which is licensed under GPLv3. The rest of the MVVMM codebase is also released under GPLv3, with two exceptions: virtio.c and virtio.h, which are licensed under the permissive MIT license.
MVVMM may not be ready for primetime just yet, but its innovative approach to virtualization is sure to captivate developers looking for a new challenge. With its tiny footprint and minimalist design, this miniature VMM is an absolute must-play for anyone interested in exploring the world of virtualization.