Show HN: SSH-hypervisor – like SSH, but each user gets their own microVM
ekzhang.substack.comThis is a project I made over the weekend. What if when you SSH'd into a machine, instead of giving you a user login, it would provision a new microVM just for you?
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.
This is a cool project! Would be interesting if this could be used to help teach and learn linux to a group of students. No need to muck about with user accounts and one could add a proxy layer and map each username to a dynamic DNS entry to help students host their own temporary webserver.
Thanks! I think that's a great idea. Containers are nice, but there's nothing quite like a "real" VM system in terms of learning + developing, and they can be very cheap if you're OK with the performance hit from nested virtualization :)
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!).
Interesting. I hope you know about busybox? This could boot ultra fast.
It uses Alpine Linux, which includes busybox as coreutils by default.