Score:0

Virt-Manager NAT network interfaces stop working if host connection is restarted

cn flag

I'm running Ubuntu (Mate) 20.04 on a workstation and I often use virt-manager to host various virtual machines for testing purposes (not for production VMs). I have found that if networking on my workstation is disabled and re-enabled, the NAT interfaces in virt-manager stop working until the host is restarted. I believe I understand this to be related to the virtual interfaces not re-initializing and connecting to my host's NIC. I was wondering if there was a way to get those interfaces working again without restarting the host.

Edit: I may have solved this, but I'm leaving this open for now to see if anyone has a better method. To replicate the issue, use the network manager indicator to uncheck Enable Networking, and then re-enable it. Host network is working at this point. Start virt-manager and launch a VM. VM will not get an IP address if using DHCP and will not be able to ping a host. My workaround is to shut down the VM and virt-manager, then run these commands:

sudo ip link set dev virbr0 down
sudo ip link set dev virbr0 up

systemctl restart libvirtd
sudo virsh net-destroy default
sudo virsh net-start default

At this point I can open virt-manager, launch a VM, and networking operates as expected.

cn flag
I may have solved this, but I'm leaving this open for now to see if anyone has a better method.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.