LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   [KVM] Guest network connection irreparably dies if the host is disconnected (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/%5Bkvm%5D-guest-network-connection-irreparably-dies-if-the-host-is-disconnected-4175735299/)

L-28C 03-25-2024 11:35 AM

[KVM] Guest network connection irreparably dies if the host is disconnected
 
Every time I disconnect my host from the Internet, all of my virtual machines lose network access permanently until I reboot the host. This happens on Linux (tested various distros) and Windows guests. Is there a workaround for this? As a last resort I could live with having to reboot the guests, but rebooting the host is overkill. Any kind of forced reboot gives me PTSD flashbacks of my Windows days.

I'm running KVM/QEMU/virt-manager on MX Linux 21.3

jayjwa 03-27-2024 02:07 PM

Vaguely, it has to do with your network topography and how you set it up. The problem I had was disconnecting a guest caused the host to lose its external IP4 address. Now I keep the guests on their bridge and the external interface separate. I don't know if you're using netplan or network manager or scripts because I'm not familiar with MX Linux, but there's a way to do it. Yes, reboot is overkill and unneeded.

yancek 03-28-2024 08:05 AM

What network settings do you have on KVM? Do you understand the difference in the various settings, particularly between NAT and bridged?

L-28C 04-08-2024 06:28 PM

Quote:

Originally Posted by jayjwa (Post 6492352)
Vaguely, it has to do with your network topography and how you set it up. The problem I had was disconnecting a guest caused the host to lose its external IP4 address. Now I keep the guests on their bridge and the external interface separate. I don't know if you're using netplan or network manager or scripts because I'm not familiar with MX Linux, but there's a way to do it. Yes, reboot is overkill and unneeded.

Pretty sure it's just Network Manager doing everything network wise

Quote:

Originally Posted by yancek (Post 6492507)
What network settings do you have on KVM? Do you understand the difference in the various settings, particularly between NAT and bridged?

I'm using "Virtual network (default)" as the NIC in virt-manager, which gives VMs IPs in the range 192.168.122.x which is fine with me. I'd rather keep it that way because I'm sure a couple of my VMs will break if I change it (specially those that need port forwarding) but I'll fiddle with the other options if there's no other way to fix it as it is. I don't really understand how they differ exactly, no

L-28C 04-15-2024 10:10 PM

I figured it out on my own guys!! This is all I have to do to restore networking to my guests:

```
ip addr add 192.168.122.1/24 dev virbr0
ip link set virbr0 up
```


All times are GMT -5. The time now is 11:14 AM.