You are not logged in.

#1 2021-05-05 17:19:39

Jeff_WuYo
Member
Registered: 2020-12-14
Posts: 37

[SOLVED] libvirt guest don't have network

I install fresh Arch and I want to use KVM, so I installed libvirt, qemu, iptables-nft, dnsmasq, edk2-ovmf, virt-manager. I run through KVM Checking according to Arch KVM wiki page, enabled libvirtd.service, but my guests just don't have any network. I notice that my virtual NIC virbr0 on host is down, is there anyway to enable it? Is it because the package ebtables is replace by iptables-nft, and libvirt doesn't support it at the moment? Or there's some setting I have to do with iptables-nft?By the time I writing this post, my latest libvirt 1:7.1.0-3 is Flagged out-of-date on 2021-05-03.
Here are some output.

$ ip addr | grep virbr0
5: 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
$ doas virsh net-list
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes
$ LC_ALL=C lscpu | grep Virtualization
Virtualization:                  VT-x
$ zgrep CONFIG_KVM /proc/config.gz
CONFIG_KVM_GUEST=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_COMPAT=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_KVM_AMD_SEV=y
CONFIG_KVM_MMU_AUDIT=y
$ lsmod | grep kvm
kvm_intel             327680  0
kvm                   970752  1 kvm_intel
irqbypass              16384  1 kvm
$ uname -sr
Linux 5.11.16-arch1-1

Last edited by Jeff_WuYo (2021-05-08 05:48:39)

Offline

#2 2021-05-05 21:10:50

Toolybird
Member
Registered: 2017-09-30
Posts: 72

Re: [SOLVED] libvirt guest don't have network

> Is it because the package ebtables is replace by iptables-nft, and libvirt doesn't support it at the moment?

It's possible. I still have the old ebtables package installed and my virbr0 is still working. (NOTE: the virbr0 only goes to UP state when a VM starts)

As a test, you could try temporarily installing iptables (to replace iptables-nft) then grabbing the old ebtables from the Arch Linux Archive [1] then report back.

[1] https://archive.archlinux.org/

Offline

#3 2021-05-06 02:11:01

Jeff_WuYo
Member
Registered: 2020-12-14
Posts: 37

Re: [SOLVED] libvirt guest don't have network

I rollback to "iptables" and "ebtables 2.0.10_4-8", the issue is still there. Another thing is that, in the section of NIC of show virtual hardware details in virt-manager, the IP address is always Unknown.

Output when VM is on,

$ ip addr
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:96:6d:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
6: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether fe:54:00:cc:5b:8f brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fecc:5b8f/64 scope link
       valid_lft forever preferred_lft forever

Offline

#4 2021-05-06 02:32:05

Toolybird
Member
Registered: 2017-09-30
Posts: 72

Re: [SOLVED] libvirt guest don't have network

> I rollback to "iptables" and "ebtables 2.0.10_4-8", the issue is still there

Yes, sorry about that. I just upgraded my system to iptables-nft (and removed ebtables) and everything still works.

I'm not sure what is causing your issue. virbr0 in state DOWN when VM is running is definitely a problem. Maybe check journal and/or enable libvirt debug log. Do you have a firewall installed? (I don't currently). I also have self-built latest libvirt-7.3.0.

Offline

#5 2021-05-07 19:34:21

Jeff_WuYo
Member
Registered: 2020-12-14
Posts: 37

Re: [SOLVED] libvirt guest don't have network

Toolybird wrote:

Do you have a firewall installed?

As far as I know, I didn't configure any firewall setting.
I took a look at my system journal, there are some weird output

libvirtd[514]: Cannot find 'dmidecode' in path: No such file or directory

systemd[1]: libvirtd.service: Found left-over process 658 (dnsmasq) in control group while starting unit. Ignoring.
systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

libvirtd[3088]: unable to open '/sys/fs/cgroup/machine.slice/machine-qemu\x2d1\x2darchlinux.scope/': No such file or directory
libvirtd[3088]: Failed to remove cgroup for archlinux

systemd-networkd[327]: rtnl: received neighbor for link '7' we don't know about, ignoring.

I tried install "dmidecode" but nothing changed.
I pull out my Arch old install ssd (didn't upgrade, still old packages), boot it on the same machine, it does work as intended. So there's must something wrong with my new install. One different between my old one and new one is, the old one has sudo and the new one does not. I already add myself into wheel group, will it somehow related to sudoers?

Update: I run "systemctl daemon-reload" and the issue is gone. But I still don't know if package "dmidecode" is require or not.

Last edited by Jeff_WuYo (2021-05-07 19:51:53)

Offline

#6 2021-05-07 22:57:54

Toolybird
Member
Registered: 2017-09-30
Posts: 72

Re: [SOLVED] libvirt guest don't have network

> But I still don't know if package "dmidecode" is require or not.

No, it's optional. I believe the main use is to enhance `virsh sysinfo' (and to remove log spam smile)

> I run "systemctl daemon-reload" and the issue is gone.

This suggests some weird network dependency issue. Which network manager are you running? I'm simply using systemd-networkd and systemd-resolved on this box.

I see mostly the same journal entries as you, except for the cgroup related one, which I think may have possibly been fixed in recent libvirt. I don't see how sudo could be related.

Offline

#7 2021-05-08 05:47:57

Jeff_WuYo
Member
Registered: 2020-12-14
Posts: 37

Re: [SOLVED] libvirt guest don't have network

Toolybird wrote:

Which network manager are you running? I'm simply using systemd-networkd and systemd-resolved on this box.

So am I. I did some change to my .network config too. Just to make sure it works fine.

For now, I think I'll ignore cgroup issue. Thx for your help.

Offline

#8 2021-10-11 21:54:36

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

Re: [SOLVED] libvirt guest don't have network

Hi, I wanted to bump this thread up because I am having this exact same problem described by the OP Jeff_WuYo.

I have exactly the same issue and unlike Jeff_WuYo, running "systemctl daemon-reload" did not resolve my issue.

To add to OP explanation, It seems that when booting up a VM, vnetX tap is created but is not added to the virbr0 bridge. If I manually add the vnetX tap to the bridge and then set the bridge up, the VM is able to connect but this has to be done every time a VM is booted. Any insight into the cause of the issue will be greatly appreciated.

Offline

#9 2021-10-12 07:06:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,431

Re: [SOLVED] libvirt guest don't have network

Since this thread is SOLVED and you have a question that isn't you shouldn't be bumping the thread, as otherwise the solution here would fix your issue as well. Please open a new thread if you have an unsolved question even if the symptoms read the same.

Offline

Board footer

Powered by FluxBB