GNU Guix image / virtual machine — Wed 09 July 2025

GNU Guix image / virtual machine

I'm trying to set up a GNU Guix virtual machine for my reverse proxy for my home network.

My read of the documentation at https://guix.gnu.org/manual/en/html_node/Invoking-guix-system.html#index-virtual-machine is that Guix VMs share their installed libraries and binaries with the host operating system. Because of the way Guix (and its parent, Nix) is engineered, this is secure and efficient. So that's super cool.

I may be wrong, but I am concerned it prevents the VMs from being portable. That is, if my Guix VM is configured when the parent operating system has apps X, Y, and Z and then I move it to another server that doesn't have Guix on the host or has Guix on the host but not apps X, Y, and Z, the VM won't work.

That's not a huge concern for me, I don't mind installing Guix and a shared set of packages on all of my current and future home-hosting hosts. But I want portable VMs, so I will instead use Guix 'images', which are described further down on the same page. Those look like full, traditional self-contained virtual machines.

I've made a first pass at it here.

I have to say I'm impressed that my first attempt booted so quickly after I built it. I'm accustomed to setting up VMs by going through a manual installer process. It's not that tedious if you're doing it once or twice a year. But if you're building new machines from scratch left and right, it gets old in a hurry. The way Guix lets you specify everything about a VM in a single .scm file is marvelous, once the .qcow2 image is built, once you start it up you don't have to step through anything. You just start working. 🎉

I wanted to try Alpine Linux, Void Linux, Gentoo, or FreeBSD in some combination. And I'm positive they have their own virtues that would make me rave. But the ability to create all of my VMs for Guix in a way that lets me fire them up and start using them fully configured might be hard to beat!