Skip to main content
Topic: Booting KVM Guest breaks internet  (Read 1214 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Booting KVM Guest breaks internet

Reply #15
I am in the process of creating a bridge, though I get an error with a wireless interface:
Code: [Select]
$ sudo ip link set wlan0 master br0
Error: Device does not allow enslaving to a bridge.

I found the following solution for wireless interface on a bridge: https://wiki.archlinux.org/title/Network_bridge#Wireless_interface_on_a_bridge. That gives me two options which method should I select:
- https://wiki.debian.org/BridgeNetworkConnections#Bridging_with_a_wireless_NIC or;
- hostapd: https://wiki.archlinux.org/title/Software_access_point
Well that complicates things. I have never done it (wlan0 to a bridge) so I'd just be reading the same documents as you! I use a wired connection on my PC.
Nothings ever simple.

I was just suggesting a possibility. Sounds like it is doable though if the following condition is met:
"Wi-Fi device must support AP mode". Make sure it does before you waste too much time on it.
It's all learning though.

I'm blessed to use Openrc with Netifrc and my whole network setup is just
Spoiler (click to show/hide)

Though I can just about remember how to bring up a wired and wifi connection in a terminal (often need my notes for wifi) which is helpful occasionally.

imho network managers are great when they work. but they sometimes think they are cleverer than they are and then just silently fail (a bit like me  :o  )
Also both networkmanager and connman seem to enjoy changing the hostname on a running system (breaks X programs) which is enough dissuade me from both of them.

I can't tell you what is the best solution for you. We have different hardware.

Re: Booting KVM Guest breaks internet

Reply #16
My wireless interface supports ap mode.

Whatever the best solution is i am willing to try. I am on xfce not Xorg. NetworkManager or connman are no requirements for me though I believe there are and there ought to be solutions even with them in mind

Laptop and wireless interfaces are common setups for linux. There is a solution. I am confident there are solutions. If we could list or test them many others would equally benefit. Though i am lucky to have AP mode in this case.


From brainstorming I can think of
- manual edits of routing table
- static Ip (which i dont prefer and want to keep to minimum🤭). Maybe a manual edit in code could prevent the occurance of default dev vnet1 scope link and it is solved with that. I could remove NM and connman and connect with wpa-supplicant for testing if the occurance is gone.
- move away from NAT and use bridge(if possible) or macvtap (cant guess if that will work)
- two options i mentioned before Here and Hostapd
- The device is portable and does not connect to the same SSID, but i could keep switching to a minimum. Manual wifi connection is a plan B or even C to my mind
- maybe other solutions or tests I did not think of


I am in need of saving and I am not convinced we have exhausted all braincells


 

Re: Booting KVM Guest breaks internet

Reply #17
Whatever the best solution is i am willing to try. I am on xfce not Xorg.
You are using X/X11/Xorg underneath Xfce. I only mentioned that issue in passing.
Quote
NetworkManager or connman are no requirements for me though I believe there are and there ought to be solutions even with them in mind
Laptop and wireless interfaces are common setups for linux. There is a solution. I am confident there are solutions. If we could list or test them many others would equally benefit. Though i am lucky to have AP mode in this case.
Yes and going from the search I recommended you do, "NetworkManager kvm breaks internet", your exact issue is a common problem. Bear in mind that KVM was designed to be used on servers. Not portable laptops over wifi. Which could be why getting it working is a little more complex than one might hope?
I can't test potential solutions as I don't use wifi and I'm not having the problem. I can only suggest them (And I could well be wrong, I often am in my own endevours).
The implementation and testing is down to you.
I was under the impression that you had solved the the problem somewhat in that you disabled NM and you did have internet while using your virtual machine?
Quote
From brainstorming I can think of
- manual edits of routing table
- static Ip (which i dont prefer and want to keep to minimum🤭). Maybe a manual edit in code could prevent the occurance of default dev vnet1 scope link and it is solved with that. I could remove NM and connman and connect with wpa-supplicant for testing if the occurance is gone.
- move away from NAT and use bridge(if possible) or macvtap (cant guess if that will work)
- two options i mentioned before Here and Hostapd
- The device is portable and does not connect to the same SSID, but i could keep switching to a minimum. Manual wifi connection is a plan B or even C to my mind
- maybe other solutions or tests I did not think of
Using my often flawed logic tells me:
You know there is a problem using networkmanager in conjuntion with virb0 nat and your wifi with the default networkmanager settings.
So you can research and try to find the setting change that will fix this. Probably, imo, on the networkmanager side but that's not a definite.
You can use a different solution. A different network manager could be one (have you tried conmman) ? No network manager seems to be one, but is sub optimal on your portable device.
Another solution might be using a bridge whether standard or macvtap. I've no experience of the latter and no experience of the former bridged to wifi.
A bridge can have other advantages over NAT anyway. As the VM gets it's own ip on the local network making bidirectional ssh/sftp, and the setup of servers such as webservers far easier. You may not need any of this ?
Quote
I am in need of saving and I am not convinced we have exhausted all braincells
You'll have to save yourself unless someone else comes along who KNOWS the answer because I don't.
I only have ideas which I've suggested. It's down to you to decide which to try and then try to test them.
But if you ask anything specific about problems along the way I'll do my best to help.