Host: Manjaro, Guest: Artix Linux, Issue: No virtio NAT connection on VM (KVM, qemu, libvirt, virt-manager, connman)

I keep having to deal with this issue.
For whatever reason the NAT connection is lost.
This time even creating a my VM again from scratch is no longer working.
An e1000e connection does work.

virt-manager connection config in xml

<network connections="1">
  <name>default</name>
  <uuid>b728bff2-6215-4472-8d38-a5a797d328aa</uuid>
  <forward mode="nat">
    <nat>
      <port start="1024" end="65535"/>
    </nat>
  </forward>
  <bridge name="virbr0" stp="on" delay="0"/>
  <mac address="52:54:00:8c:9c:74"/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254"/>
    </dhcp>
  </ip>
</network>

VM network interface config in xml

<interface type="network">
  <mac address="52:54:00:8d:cd:66"/>
  <source network="default" portid="94cebc1a-2b7b-41ba-91a4-22958fe3aef4" bridge="virbr0"/>
  <target dev="vnet4"/>
  <model type="virtio"/>
  <alias name="net0"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

ip addr on guest

ip addr on host

$ ip addr
...
4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:8c:9c:74 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
9: vnet4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master virbr0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:8d:cd:66 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe8d:cd66/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

network device

<interface type="network">
  <mac address="52:54:00:8d:cd:66"/>
  <source network="default" portid="94cebc1a-2b7b-41ba-91a4-22958fe3aef4" bridge="virbr0"/>
  <target dev="vnet4"/>
  <model type="virtio"/>
  <alias name="net0"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

Did you read the stable announcement?

What stable announcement?

Virtual machines using libvirt have no internet if the host uses UFW
This is a known bug 5. “Workaround” is to change the firewall with firewalld or to disable UFW.
Another easier workaround is to edit /etc/libvirt/network.conf, and add
firewall_backend = “iptables”

2 Likes

Does this count for Linux 6.6.41-1 as well?

$ inxi
CPU: quad core Intel Pentium Silver J5040 (-MCP-)
speed/min/max: 1174/800/3200 MHz Kernel: 6.6.41-1-MANJARO x86_64
Up: 1d 22h 59m Mem: 6.89/34.9 GiB (19.8%) Storage: 1.98 TiB (18.9% used)
Procs: 271 Shell: Bash inxi: 3.3.35

I forgot to tell by the way that e1000e connections work, but virtio doesn’t.
I had this issue before, but then rebuilding the VM worked back then.

Yes it works on 6.6. It can get reset on update unfortunately, seems like the packager forgot to include the file in the list of files to generate .pacnew. I dropped a line at F.Swan about it so hopefully it will be fixed.

About the choice of adapter - i can confirm something else is going on there, because my different virtual machines “like” one or the other. I still have not found the time to dig into it. I just switch as needed. I think it is dependent on the type of guest.

What do you mean by ‘“like” one or the other’?

One guest os worked only with e1000, one only with virtio. But i have deinstalled them since and cannot test now.

I’ve solved my own issue by editing my network interface xml model type to “virtio-net” instead of “virtio”.
I’m not sure why virt-manager only gives me two model options.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.