There is a hard-to-{troubleshoot,reproduce} error that sometimes occurs when running libvirtd and zerotier-one at the same time.

It will usually cause an error when starting the libvirt network that the interface is already in use.


#!/bin/sh

sudo systemctl start zerotier-one
sleep 3
sudo systemctl start libvirtd
sleep 3
if [ "$(ip route show to match 192.168.122.124 | grep ztly)" ]; then
    sudo ip route del 192.168.122.0/24 dev ztly527s2g
fi
sudo systemctl restart libvirtd

sleep 1
virsh net-start default

sudo systemctl start libvirt-guests