MuStack MicroVM: An Overcomplicated Solution to a Problem That Doesn't Exist

I have a habit of diving headfirst into projects that are fun but maybe not super useful. A project I worked on a few months ago  MuStack MicroVM (msmv) —a project that took far more effort than necessary to create something that, in all honesty, I’ll probably never use again. But hey, at least it works, right?

 

So, What Exactly is msmv?

At its core, MuStack MicroVM is a minimalistic Linux virtual machine build system. Think Docker, but without all the convenience and with way more manual labour involved. It's designed to create lightweight, secure, and isolated virtual machines for testing environments. Perfect if you're someone who enjoys the thrill of complexity, like building a ship in a bottle—but digitally. Plus, I'm a sucker for naming projects with an acronym.

It uses QEMU’s microvm machine type (mostly) to deliver quick boot times and efficient resource use. In theory, it’s a neat idea. In practice? Well, let's just say I overcomplicated things a little bit and in the end, turns out its not viable for my initial vision (more on that later)

Why did I build this?

Because I could.

Seriously though, the idea came from a late-night rabbit hole, where I thought, “Wouldn’t it be cool to have a microVM system that’s completely customizable?” Fast forward through several hours of coding and a couple of questionable design choices, and here we are. Was there a specific problem I was trying to solve? Not really. But there’s something about making your life harder with an unnecessary tech challenge that feels oddly rewarding.

SnackLinux is a Linux distro that I started years ago with the goal to be completely transparent and controllable by a single Makefile. I'm a proponent of software that you can build by bootstrapping the entire thing (Fiwix is a great example). While neither msmv or SnackLinux follows that process, I like the idea of the "no magic" software build systems. To build the newest version of Rust....the previous version of Rust is used. Chicken and the egg type stuff.

How It Works (In Case You Want to Torture Yourself Too)

Rather than reprint the entire README, I’ll give you the short version:

  1. You start with a TOML configuration file (because what’s more fun than manually configuring your builds?).
  2. Run a Python script to pull down the Linux kernel, build it, and set up a root filesystem.
  3. Smile and wonder why you didn’t just use Docker.

If you’re a glutton for punishment like me, you can find the full instructions on the GitHub repository. You’ll probably spend more time tweaking environment variables than actually using the VM, but hey, that’s part of the charm.

What’s the Point?

Going into it I had the idea of:

  • You find some software on Github, not sure how it runs
  • You create a msmv TOML config file to build the software
  • You run the msmv virtual machine and it boots only directly into the target software
  • No dependencies needed, other than standard gcc build tools and a fast internet connection
  • You can share the template TOML files with other users to build, run and boot the target software

The issues I ran into, which I experienced when making my own Linux distros, is dependency hell. To build any software, you need so many other libraries, an some software just plain won't work statically. So creating a TOML template for msmv would require building all the software's dependencies, which is understandable, but also a huge pain in the ass. Let's say your target software uses Python. We'd have to compile Python, and any modules that are needed, beforehand and pray that everything works fine. Now, not all software is like this and I have working version of GNU nano and lynx but that's besides the point.

And since we're not using any distro build systems like Buildroot, essentially we're building single-purpose mini Linux distros with msmv. Completely unnecessary to run a single C program, but what isn't unnecessary nowadays? 
 

 

As far as the over arching point and real world use case? Honestly, I’m not sure there is one. But sometimes, the best projects are the ones that don’t solve any real problem—they just give you a reason to tinker. MuStack MicroVM was one of those “I bet I can do this” moments, and now that it's done, I can confidently say: I did it and it mostly works. Will I use it again? No! But it's always fun to hyperfocus on something for a few weekends, put it on Github and then send to all your geek friends so you can bask in your accomplishment. I think that's the part of projects like these that are the most enjoyable: building something from an idea, getting it truly working and taking a retrospective look at building it. I don't write software for a living and don't plan to, so "working on the weekend" is stuff like this.

Tags