# Virtual network switch keeps disappearing

**URL:** <https://forum.systemcrafters.net/t/virtual-network-switch-keeps-disappearing/1919>\
**Category:** Guix\
**Created:** [March 5, 2026, 3:49pm UTC](https://forum.systemcrafters.net/t/virtual-network-switch-keeps-disappearing/1919 "2026-03-05T15:49:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Folaht](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/folaht/32/1145_2.png) [@Folaht](https://forum.systemcrafters.net/u/Folaht)\
**Post date:** [March 5, 2026, 3:49pm UTC](https://forum.systemcrafters.net/t/virtual-network-switch-keeps-disappearing/1919/1 "2026-03-05T15:49:17Z")

</div>

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

```plaintext
$ 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:

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

$ 

```

It disappeared. What happened?

---

<div class="post-metadata">

**Author:** ![aionfork](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/aionfork/32/1243_2.png) [@aionfork](https://forum.systemcrafters.net/u/aionfork)\
**Post date:** [April 27, 2026, 4:34am UTC](https://forum.systemcrafters.net/t/virtual-network-switch-keeps-disappearing/1919/2 "2026-04-27T04:34:55Z")

</div>

Look at [Custom NAT-based network for libvirt](https://guix.gnu.org/cookbook/en/guix-cookbook.html#Routed-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.
