34 points · by ekzhang · 1y ago · 4 comments
It's like a little SimCity for VMs.
This turned out to be a lot of fun, and I've wanted to make my own custom SSH server for a while now, with its fancy progress bars and color animations. The hardest part was definitely debugging VM setup, boot, and networking though! Compiling the Linux kernel with all the right configs was difficult. For a while I had issues with silent hangs on boot due to lack of available system entropy, on Linux <4.19. Anyway, I wrote a bit about my struggles. :D
I managed to bundle everything (vmlinux 6.1, firecracker, SSH server, iptables/bridge/masquerade) into a single, statically-linked binary for x86_64/aarch64. It takes the kernel rootfs as a command-line argument.
Another idea I had is to customize the rootfs. It boots Alpine right now, but should be trivial to change it to anything else (and it only takes ~5 seconds to build!).