I’ve been using libvirt for running and managing my local virtual machines for over a decade now. It’s great! I’ve found it to be quite reliable, if a little uncomfortable to script. I don’t mind a little discomfort for something that works as well as libvirt has worked for me.

One thing I miss from using things like OpenStack is creating a bunch of VMs from a single description file. I wrote a little tool to do that for myself. The VMs are still managed by libvirt, but vmadm (also on crates.io) tells it what kind of VM to create. For example, the following specification file defines two VMs:

I run one command to create both:

I can also delete both at once:

vmadm can also generate an SSH host certificate, an SSH host key signed with an SSH CA key. This allows me to log into a new VM without having to accept its host key - even if the host key has changed from the previous VM with the same name.

(I know there’s existing tools for this, but I found it easier to write a little helper than to learn a whole ecosystem around the ones I found.)