It doesn't help if the network management tool has been started but the network itself is not set up yet. In my case the NetworkManager creates a network bridge which is needed for the VM of libvirt. But without correct dependency the VM starts before the NetworkManager can do its job. In the service-unit "libvirtd.service" should "After=network.target" replaced by "After=network-online.target" My Setup: app-emulation/libvirt-5.5.0-r1 net-misc/networkmanager-1.16.0 sys-apps/systemd-242-r6
-(In reply to Stefan Schmid from comment #0) > It doesn't help if the network management tool has been started but the > network itself is not set up yet. > > In my case the NetworkManager creates a network bridge which is needed for > the VM of libvirt. But without correct dependency the VM starts before the > NetworkManager can do its job. > > In the service-unit "libvirtd.service" should "After=network.target" > replaced by "After=network-online.target" We install the systemd service exactly as shipped by upstream. The "After=network.target" dependency seems to be correct - strictly speaking libvirt (and guests) do not need immediate internet access. May I suggest two solutions for your special configuration case: - You can override the service unit by creating, say, /etc/systemd/system/libvirtd.service.d/99not-too-early.conf with something like (untested) [Unit] After=network-online.target Alternatively: - I personally use systemd-networkd for the static bits of my network configuration which happens to be precisely a bridge for libvirt: /etc/systemd/network/br0.netdev: [NetDev] Name=br0 Kind=bridge MACAddress=<something> /etc/systemd/network/br0.netdev: [Match] Name=br0 [Link] RequiredForOnline=yes [Network] Address=<something> ConfigureWithoutCarrier=yes IPForward=yes Never encountered any issues or race conditions with that. I hope that helped you with your configuration :-)
I'm already using the override as a workaround. I just thought that for others this would avoid a similar problem.
(In reply to Stefan Schmid from comment #2) > I'm already using the override as a workaround. > I just thought that for others this would avoid a similar problem. No worries, thanks a lot for the bug report. It is just that we have to be a bit conservative with configuration changes of that kind. (Switching the default configuration in such a way has the potential to break a fair number of installations.)
If libvirt should ever get its own entry in the Gentoo-Wiki, would that be something that should be mentioned there? PS: Thanks for responding to this bug report and explanation.