You are not logged in.

#1 2021-10-12 17:57:47

psilokrn
Member
Registered: 2021-10-11
Posts: 6

Libvirt will not add vnet to virbr0

Hello everyone, I am having issues with my VM not connecting to the internet. I have a fairly fresh Arch install, and I followed the wiki on how to set up GPU passthrough and successfully got my VMs running. The problem is I have no internet access in the VM using default NAT. I found that upon starting the VM, vnet tap is created but is not added to the virbr0 bridge on the host and virbr0 stays down. I can run "brctl addif virbr0 vnet" and then "ip link set virbr0" to manually add the tap and set the virbr0 up and the VM can connect. However, this needs to be done every time I start a VM which isn't ideal. I've looked into using a network bridge instead of NAT for the VM but because host is on WiFi, that is not easily possible.

I have installed qemu, libvirt, edk2-ovmf, virt-manager, iptables-nft and dnsmasq.

When VM is off:

$ ip addr | grep 'virbr0\|vnet'
9: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

When VM is on:

$ ip addr | grep 'virbr0\|vnet'
9: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
12: vnet2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
$ sudo virsh net-list
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes

Offline

#2 2021-10-12 19:07:22

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: Libvirt will not add vnet to virbr0

I guess you have a configuration error in virt-manager. Are you sure you have started/auto-started the interface there (with the buttons in the lower left corner)? You shouldn't need any manual shell intervention when using virt-manager.


sys2064

Offline

#3 2021-10-12 19:17:26

psilokrn
Member
Registered: 2021-10-11
Posts: 6

Re: Libvirt will not add vnet to virbr0

Yes, in virt-manager the default virtual network state is active and autostart is enabled.

Offline

#4 2021-10-13 10:59:45

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: Libvirt will not add vnet to virbr0

Maybe you have some interfering network manager running in the background occupying or changing the bridge.


sys2064

Offline

#5 2021-10-16 23:38:58

psilokrn
Member
Registered: 2021-10-11
Posts: 6

Re: Libvirt will not add vnet to virbr0

Maniaxx wrote:

Maybe you have some interfering network manager running in the background occupying or changing the bridge.

Is there any way to see if this is the case?

I just did a fresh install of Arch and still having the same problem. I did notice that after running the VM if I check the status of systemd-resolved.service I get the following. Not sure if it's related as I'm not sure what this is saying.

Oct 16 16:26:21 arch systemd-resolved[412]: vnet0: Failed to read DNSSEC negative trust anchors for the interface, ignoring: No data available

Offline

#6 2021-10-17 17:01:00

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: Libvirt will not add vnet to virbr0

Do you import a configuration in virt-manager? The program is not very 'failsafe'. Its possible to have orphaned network profiles connected to a NIC. Maybe try to delete the NIC, re-add it and re-assign the network profile.
Other than that i cannot reproduce the bug here. Even though i mostly use 'open network' these days (and handle forwarding manually) the vnat interfaces are always connected properly to the bridge.


sys2064

Offline

#7 2021-10-17 18:41:28

psilokrn
Member
Registered: 2021-10-11
Posts: 6

Re: Libvirt will not add vnet to virbr0

I am importing the configuration, however, I have tried with several new VM configurations as well as adding and removing the NIC and the results are the same. I installed Fedora on a spare SSD and tried the same VMs with the same configurations and did not have this issue.

I have found two other instances where someone was having the same issue and they both were on Arch.

User Jeff_WuYo was having the same issue and seemed to have fixed it by running "systemctl daemon-reload" but this did not fix the issue for me.
https://bbs.archlinux.org/viewtopic.php?id=266082

This is another user on Reddit having the same issue, also on Arch, and was not able to find a solution.
https://www.reddit.com/r/VFIO/comments/ … s_running/

Offline

#8 2021-10-17 21:47:36

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: Libvirt will not add vnet to virbr0

Maybe check the debug logs:
https://wiki.debian.org/libvirt/Debugging


sys2064

Offline

#9 2021-10-27 22:42:52

storms
Member
Registered: 2018-11-09
Posts: 26

Re: Libvirt will not add vnet to virbr0

I'm having the EXACT same problem on a fresh  arch Linux install (it's literally 2 days old).
The only difference is that I followed https://github.com/xiagw/winapps/blob/main/docs/KVM.md to install the windows 10 (alongside the archwiki ofc, everything works fine aside from this one networking issue).
Applying the fix that psilokrn talks about works.

One clue I would like to leave here, since my technical skills are failing me:

Last reply of the thread, the user xabbu writes:
"... you use systemd-resolved with the stub resolver? Because libvirt starts a dnsmasq process that needs to listen on 192.168.122.1:53, but port 53 might be taken for all addresses by systemd-resolved."
https://forum.manjaro.org/t/no-internet … s/75146/14

Offline

#10 2021-10-31 04:13:29

psilokrn
Member
Registered: 2021-10-11
Posts: 6

Re: Libvirt will not add vnet to virbr0

storms wrote:

I'm having the EXACT same problem on a fresh  arch Linux install (it's literally 2 days old).
The only difference is that I followed https://github.com/xiagw/winapps/blob/main/docs/KVM.md to install the windows 10 (alongside the archwiki ofc, everything works fine aside from this one networking issue).
Applying the fix that psilokrn talks about works.

One clue I would like to leave here, since my technical skills are failing me:

Last reply of the thread, the user xabbu writes:
"... you use systemd-resolved with the stub resolver? Because libvirt starts a dnsmasq process that needs to listen on 192.168.122.1:53, but port 53 might be taken for all addresses by systemd-resolved."
https://forum.manjaro.org/t/no-internet … s/75146/14

Systemd-resolved listening on port 53 was an issue for dnsmasq, which I fixed, but it did not fix this issue.

Offline

#11 2022-01-18 21:16:42

effraie
Member
Registered: 2012-08-30
Posts: 66

Re: Libvirt will not add vnet to virbr0

@psilokrn : any news on that topic ? i'm running into the same issue, here : https://bbs.archlinux.org/viewtopic.php?pid=2016529

Offline

#12 2024-02-12 21:45:41

dozy lizard
Member
Registered: 2024-02-11
Posts: 2

Re: Libvirt will not add vnet to virbr0

I ran into this problem and in my case it was because systemd-networkd was configuring vnet0,

I run systemd-networkd as well as NetworkManager with the former configuring ethernet (wired) configurations and the latter just for wifi and bluetooth.

The problem is, my systemd.network file had

[Match]
Type=ether

which apparently also matches virtual networks. I added

Driver = !tun

which fixes it.

I'm not sure that this is the best solution. It seems to me there should a way, in the libvirt network configuration, to say "managed by libvirt" but I can't see anything.

Offline

Board footer

Powered by FluxBB