Virtual network switch keeps disappearing

So here’s how I create a virtual network switch:

$ sudo virsh net-define /etc/libvirt/storage/default.xml
$ sudo virsh net-start default

But once I do a reboot, here’s what I get:

$ sudo virsh net-list --all
 Name      State    Autostart   Persistent
--------------------------------------------

$ 

It disappeared. What happened?

Look at Custom NAT-based network for libvirt

I haven’t used virtd a ton, but i think you can define the many/most of the devices in the guix system’s operating-system record, then define the VM’s XML to match what’s on the VM host.

An alternative is to create a shepherd service under the system’s services that runs those commands on boot. That’s a bit more complicated and maybe has some failure-modes & corner cases. It requires writing a bit more guile scheme.