Hello.
I had been using linux and Windows guests with QEMU KVM for a long time with no issues on
LinuxMint 21.2. Then one day all the linux guests could not connect to the internet
effectively. (I guess, an
apt upgrade
has some responsibility here, not sure).
Then I installed LinuxMint 22, hoping to get an overall upgrade. Setup a Debian 12 KVM
guest anew but noticed the same issues. I can ping websites from inside the VM and there
are no packet loss. But other than that, the VM seemingly cannot connect to the internet.
`ping wikipedia.org` works flawless but `curl` results in the following:
$ curl -v 'wikipedia.org'
Trying 103.102.166.224:80...
Trying [<IPv6 address>]:80...
Immediate connect failed for [<IPv6 address>]:80... Network is unreachable
doing an apt update also results in Network unreachable.
Also, Firefox cannot load websites. So it appears the guest vm can only resolve dns names
and nothing else.
Surprisingly, I have a Windows guest that has no internet issue at all; websites load fine
in Edge. My Android Virtual Device (which uses qemu) works fine too.
What might be the problem here? Am I missing some configuration in the host?
Any help is appreciated. What other info can I post here to help identify the problem?
$ uname -a
Linux hp 6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 4 02:06:24 UTC 2024
x86_64 x86_64 x86_64 GNU/Linux
$ virsh net-dumpxml default
<network connections='1'>
<name>default</name>
<uuid>...</uuid>
<forward mode='nat'>
<nat>
<port start='1024' end='65535'/>
</nat>
</forward>
<bridge name='virbr0' stp='on' delay='0'/>
<mac address='52:54:00:44:e6:c0'/>
<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>
The network tag from xml config for this debian12 VM is
<interface type="network">
<mac address="52:54:00:79:b8:39"/>
<source network="default"
portid="c2529d6f-088f-4b5d-8829-625d494213e5" bridge="virbr0"/>
<target dev="vnet0"/>
<model type="virtio"/>
<alias name="net0"/>
<address type="pci" domain="0x0000" bus="0x02"
slot="0x00" function="0x0"/>
</interface>
From inside the guest
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group
default qlen 1000
link/ether 52:54:00:79:b8:39 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.65/24 brd 192.168.122.255 scope global dynamic noprefixroute enp2s0
valid_lft 2549sec preferred_lft 2549sec
inet6 fe80::b96d:f09b:80d1:b1ae/64 scope link noprefixroute
valid_lft forever preferred_lft forever