Closed alexbakker closed 2 years ago
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
This is still an issue.
I marked this as stale due to inactivity. → More info
Unstale; I'll try to find the time to poke at this since I've been doing a little work on the libvirt package.
Still an issue. Made a workaround for the meantime:
systemd.services.destroy-libvirtd-default-network = {
path = [ pkgs.libvirt ];
requires = [ "libvirtd.service" ];
after = [ "libvirtd.service" ];
wantedBy = [ "multi-user.target" ];
script = ''
if [[ $(virsh net-list --name) == *"default"* ]]; then
virsh net-destroy default && virsh net-undefine default
else
echo "libvirt default network has already been destroyed"
fi
'';
};
Caused by this: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/libvirtd.nix#L194
Also, much nicer workaround:
{
systemd.services.libvirtd-config.script = lib.mkAfter ''
rm /var/lib/libvirt/qemu/networks/autostart/default.xml
'';
}
I marked this as stale due to inactivity. → More info
still annoying to me
Please see PR. Welcome to comments as to whether it’s the best option or not. https://github.com/NixOS/nixpkgs/pull/186358
Fixed by @amarshall in #186358. Thanks!
I've stumbled upon this when trying to figure out how to set a default network. Now that it is not set automatically, how can I set it?
@rickykresslein Put whatever you want to be the default network in /var/lib/libvirt/qemu/networks/autostart/default.xml
. If you want to copy the default “default network” from the libvirt pkg, it’s in ${pkgs.libvirt}/var/lib/libvirt/qemu/networks/autostart/default.xml
.
Describe the bug The default virtual network for libvirt cannot be persistently removed or disabled.
To Reproduce Steps to reproduce the behavior:
virtualisation.libvirt.enable = true;
.virsh net-list
.virsh net-destroy default && virsh net-undefine default
.virsh net-list
.systemctl restart libvirtd
.Expected behavior I expected the 'default' network to still be gone after a restart of libvirtd.
Metadata
Maintainer information: