QEMU Documentation Reorganisation

Hello all,

I am currently invested in learning to use QEMU to allow for fine-grained control over system and network virtualisation, using existing Linux tools declared with Nix. This seems like a perfect use case for Nix, turning it into a mature infrastructure as code language for provisioning and scaling machines, networks, or whatever. I am however surprised to find that the Nix documentation on this is sparse to non-existent.

I wanted to gauge if there is any community interest in a concerted effort to reorganise the existing documentation into something more coordinated, holistically outlining the various approaches that can be taken to building VMs. The problem I see with the current state of the docs is that each page I’ve found takes a completely different approach, with no concerted effort to maintain a single thread across different approaches and what use cases they might be beneficial for. This makes navigating the docs and general troubleshooting difficult, and knowledge discovery becomes prohibitively high for newcomers.

I would be happy to take lead on this if I can find the time/energy to invest in it, but I’m also conscious that I am still relatively new to both QEMU and Nix, so maybe I could do with some help from those who are a bit more knowledgeable. I think it would be especially helpful if anyone who does use QEMU with nix could share a little bit about their usage and experience with it, or existing blog posts that they have found useful, so that we can start getting the information all in one place.

I would love to have a good QEMU resource for the community because I personally think this is a really good application for Nix. It would be great to get to a state where we have moved from ad hoc documentation to something more coordinated and official.

There are currently no discussions open on the Nix wiki pages.

Resources:

5 Likes

Sadly, I found that it was difficult to get sound working reliably with declarative solutions, so nowadays I use quickemu to configure QEMU, which is just a little bit declarative and is not integrated with NixOS.

2 Likes

You can ignore the unofficial wiki as it’d inevitably be more outdated and misinformed.

I also personally use quickemu for scenarios where security/hardening isn’t the primary goal.

2 Likes

Thanks for the input guys!

I think I will definitely keep digging into QEMU for the security/hardening side of things, but I’ll take a look at quickemu as well for anything requiring quick iteration. I’m wondering how a reliable NixOS setup with sensible defaults might compare with quickemu. I’ll keep looking into it.

I made a Nix flake POC which separates out a NixOS configuration from the VM configuration so that each machine can be declared as its own flake. This was inspired by the nix.dev approach, which creates an executable result to bootstrap the VM that I was able to adapt to flakes with a little bit of effort. This suggests to me that, with a little more exploration, playing around with nix concepts and QEMU concepts could produce more interesting outcomes than are currently documented.

Currently I’m looking mainly into networking with the VMs and will probably look at how to pass through storage layers next.

1 Like