No internet qemu guest os

I am trying to setup a windows guest VM with Qemu. I managed to do so by following the article QEMU on the Arch Linux wiki and I also referred this article Windows Guest VM using Qemu , the setup and installation were smooth with no issues, but VM does not have internet. The guest sees the network adapter and driver but reports no internet.

what could be causing this? how do I go about troubleshooting this?

My system info is as follows

      ~  inxi -F                                       ✔  03:18:46 PM   
  Host: jose Kernel: 5.4.134-1-MANJARO x86_64 bits: 64 Desktop: GNOME 40.3 
  Distro: Manjaro Linux 
  Type: Laptop System: Micro-Star product: GS65 Stealth 8SF v: REV:1.0 
  serial: <superuser required> 
  Mobo: Micro-Star model: MS-16Q4 v: REV:1.0 serial: <superuser required> 
  UEFI: American Megatrends v: E16Q4IMS.116 date: 10/07/2019 
  ID-1: BAT1 charge: 40.8 Wh (73.9%) condition: 55.2/80.3 Wh (68.7%) 
  volts: 15.5 min: 15.2 
  Info: 6-Core model: Intel Core i7-8750H bits: 64 type: MT MCP cache: 
  L2: 9 MiB 
  Speed: 3294 MHz min/max: 800/4100 MHz Core speeds (MHz): 1: 3294 2: 3045 
  3: 1256 4: 2174 5: 3446 6: 2774 7: 3398 8: 3294 9: 2732 10: 2433 11: 2923 
  12: 2713 
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] driver: i915 v: kernel 
  Device-2: NVIDIA TU106M [GeForce RTX 2070 Mobile] driver: nvidia 
  v: 470.57.02 
  Device-3: Acer HD Webcam type: USB driver: uvcvideo 
  Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting,nvidia 
  resolution: 1: 1920x1080~144Hz 2: 1920x1080~144Hz 
  OpenGL: renderer: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2 
  v: 4.6.0 NVIDIA 470.57.02 
  Device-1: Intel Cannon Lake PCH cAVS driver: snd_hda_intel 
  Sound Server-1: ALSA v: k5.4.134-1-MANJARO running: yes 
  Sound Server-2: PulseAudio v: 14.2 running: yes 
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi 
  IF: wlo1 state: up mac: 04:ea:56:b6:31:d1 
  Device-2: Qualcomm Atheros Killer E2500 Gigabit Ethernet driver: alx 
  IF: enp61s0 state: down mac: 00:d8:61:06:44:e1 
  IF-ID-1: docker0 state: down mac: 02:42:41:66:b4:51 
  IF-ID-2: virbr0 state: down mac: 52:54:00:78:1d:97 
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB 
  driver: btusb 
  Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running 
  rfk-block: hardware: no software: yes address: see --recommends 
  Local Storage: total: 1.38 TiB used: 409.17 GiB (29.1%) 
  ID-1: /dev/nvme0n1 vendor: Kingston model: RBUSNS8154P3512GJ 
  size: 476.94 GiB 
  ID-2: /dev/nvme1n1 vendor: Samsung model: SSD 970 EVO Plus 1TB 
  size: 931.51 GiB 
  ID-1: / size: 816.43 GiB used: 409.15 GiB (50.1%) fs: ext4 
  dev: /dev/nvme1n1p3 
  ID-2: /boot/efi size: 296 MiB used: 26 MiB (8.8%) fs: vfat 
  dev: /dev/nvme0n1p1 
  ID-1: swap-1 type: file size: 64 GiB used: 0 KiB (0.0%) file: /swapfile 
  System Temperatures: cpu: 60.0 C mobo: N/A gpu: nvidia temp: 58 C 
  Fan Speeds (RPM): N/A 
  Processes: 320 Uptime: 1h 19m Memory: 31.26 GiB used: 3.31 GiB (10.6%) 
  Shell: Zsh inxi: 3.3.06 

My configuration for the Windows Guest VM is as follows

<domain type="kvm">
    <libosinfo:libosinfo xmlns:libosinfo="">
      <libosinfo:os id=""/>
  <memory unit="KiB">4194304</memory>
  <currentMemory unit="KiB">4194304</currentMemory>
  <vcpu placement="static">4</vcpu>
    <type arch="x86_64" machine="pc-q35-6.0">hvm</type>
    <boot dev="hd"/>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    <vmport state="off"/>
  <cpu mode="host-model" check="partial"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" discard="unmap"/>
      <source file="/var/lib/libvirt/images/win10.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/home/jose/Downloads/Win10_21H1_EnglishInternational_x64.iso"/>
      <target dev="sdb" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/home/jose/Downloads/virtio-win-0.1.185.iso"/>
      <target dev="sdc" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    <controller type="pci" index="0" model="pcie-root"/>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="1" port="0x10"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    <controller type="pci" index="8" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    <interface type="network">
      <mac address="52:54:00:19:e3:55"/>
      <source network="default"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
    <console type="pty">
      <target type="serial" port="0"/>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    <audio id="1" type="spice"/>
      <model type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    <watchdog model="i6300esb" action="reset">
      <address type="pci" domain="0x0000" bus="0x08" slot="0x01" function="0x0"/>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    <rng model="virtio">
      <backend model="random">/dev/urandom</backend>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>

Any help would be much appreciated.

How did you set up your default network?

If you use libvirt with virsh check for example

virsh net-info default


virsh net-dumpxml default

If you use plain Qemu, you need to set it up yourself. Check out

I used virt manager to do VM setup and during the setup process the virtual network interface was already present, I just changed the Device model to virtio. Beyond that I didn’t do anything.

I ran the commads you provided and both result in failed to get the network ‘default’

      ~  virsh net-info default                        ✔  06:51:33 PM   
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'
      ~  virsh net-dumpxml default                 INT ✘  06:53:53 PM   
error: failed to get network 'default'
error: Network not found: no network with matching name 'default'

Does this mean I have to setup the network ?

Of course. In your screenshot, you see Network Source - Virtual network ‘default’ . It needs to configured correctly. It is part of the Host setup.

In Virtual Machine Manager it can be done via Edit → Connection details in the main overview window.

Thank you for clarifying that, it was my understanding that the initial setup wizard took care of that. I checked the Connection details option and I see there is already an IPv4 configuration.

  <forward mode="nat">
      <port start="1024" end="65535"/>
  <bridge name="virbr0" stp="on" delay="0"/>
  <mac address="52:54:00:78:1d:97"/>
  <ip address="" netmask="">
      <range start="" end=""/>

Is there something missing or is the configuration wrong ?

It does not state to which device. I usually add dev="myInternteDevice" (like dev="eth0"), but it seems it is not required.

The Kernel parameter net.ipv4.ip_forward should be set automatically. But you might want to check it

sysctl net.ipv4.ip_forward

If this looks ok, you need to go back to the VM, and do some Windows Networking troubleshooting.

If your laptop uses a wireless link to connect to the Internet, then a bridged network is rather challenging. The wireless standards don’t support bridging, there is a workaround but it’s rather difficult.

If your computer is connected to the router via a cable, then a network bridge works and provides the best performance. The network bridge should be setup on the host, for example by using NetworkManager.

Here is the xml configuration of a network bridge (part of the VM configuration):

<interface type="bridge">
  <mac address="52:54:00:e1:01:01"/>
  <source bridge="bridge0"/>
  <model type="virtio"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>

If you have a wireless connection, use the default NAT network type offered by virt-manager.

When you configure the Windows guest, you need to have the driver ISO ready to install the virtio network driver. Did you install the driver under Windows?

Another thing you should change in your configuration is memballoon. Set it to “none”.

Bottom line: If you run your VM on a laptop (that uses wireless), DON’T use a network bridge. Instead, choose the standard NAT network. Also, don’t configure a bridge on the host. Make sure to install the virtio network driver under Windows.

(Unfortunately I use a bridge and can’t show examples of a NAT configuration.)

I tried adding the line dev=“wlo1”, since I am using wifi, the config looked like this afterward

  <forward mode="nat" dev"wlo1">
      <port start="1024" end="65535"/>
  <bridge name="virbr0" stp="on" delay="0"/>
  <mac address="52:54:00:78:1d:97"/>
  <ip address="" netmask="">
      <range start="" end=""/>

when I try to apply changes I get an error message

Error changing network settings: (network_definition):4: Specification mandates value for attribute dev
  <forward mode="nat" dev"wlo1">

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/", line 333, in _net_apply
  File "/usr/share/virt-manager/virtManager/object/", line 339, in define_xml
    self._redefine_xml_internal(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/object/", line 366, in _redefine_xml_internal
  File "/usr/share/virt-manager/virtManager/object/", line 54, in _define
    return self.conn.define_network(xml)
  File "/usr/share/virt-manager/virtManager/", line 556, in define_network
    return self._backend.networkDefineXML(xml)
  File "/usr/lib/python3.9/site-packages/", line 4924, in networkDefineXML
    raise libvirtError('virNetworkDefineXML() failed')
libvirt.libvirtError: (network_definition):4: Specification mandates value for attribute dev
  <forward mode="nat" dev"wlo1">

I tired checking and it returns the value 1

       ~  sysctl net.ipv4.ip_forward                                                                                                                          ✔  38s    10:12:30 PM   
net.ipv4.ip_forward = 1

as @xabbu @heiko_s mentioned I made sure to load drivers during guest os installation and I also installed the virtio guest drivers after install. I used the stable virtio-win ISO from this github page to load drivers during guest installation and virtio guest drivers after installation.

When I ipconfig -all in the guest os I get the following

You forget the equal sign.

You can see in the screen shot from the VM, that the DHCP worked and all IP address are correct assigned.

The next step would be to ping. Start with, then the IP of the host, the IP of your Router and some IPs form the internet.

After that would need to check DNS, use nslookup on the windows host.

Thank you, quite the embarrassing mistake (facepalm moment). I corrected it but still no internet.

I am able to ping

C:\Users\Jose>ping                                                                                                                                                                                                                Pinging with 32 bytes of data:                                                                            
Reply from bytes=32 time<1ms TTL=64                                                                      
Reply from bytes=32 time<1ms TTL=64                                                                      
Reply from bytes=32 time<1ms TTL=64                                                                      
Reply from bytes=32 time<1ms TTL=64                                                                                                                                                                                              Ping statistics for                                                                                         
 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),                                                                
Approximate round trip times in milli-seconds:                                                                             
 Minimum = 0ms, Maximum = 0ms, Average = 0ms  

when I try to ping the host, I get this

C:\Users\Jose>ping                                                                                                                                                                                                                Pinging with 32 bytes of data:                                                                            
Reply from Destination host unreachable.                                                                 
Reply from Destination host unreachable.                                                                 
Reply from Destination host unreachable.                                                                 
Reply from Destination host unreachable.                                                                                                                                                                                        
Ping statistics for                                                                                          
 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),     

On a positive note, I am able to ping my router, and I am even able to access the router settings through the browser.

When I use nslookup I get the following

Default Server:  UnKnown                                                                                                
Address:                                                                                                                                                                                                                         >      

This is positive. You should now try to ping internet IPs, like

You can do DNS checks with nslookup. For example




Can you configure a DNS in Windows? For DNS use for example If you can ping the router from the VM, you should have internet access.

One more thing to look for is your host firewall settings.

I am able to ping IP, but when try DNS checks with nslookup as you mentioned I got the following

Server:  UnKnown                                                                                                        
*** UnKnown can't find Query refused   

@heiko_s as you mentioned I tried configuring the DNS and I used the following settings.

Preferrred DNS server :
Alternative DNS server:

and that solved my problem, now I am able to access the internet.

@xabbu @heiko_s Thank you for your help and time, helping me troubleshoot this issue.

Great news! Just remember to also turn off memballoon as mentioned in one of my previous posts. For some inexplicable reason virt-manager turns memballoon on by default. It doesn’t work with Windows.

Also note that host-model is not the same as host-passthrough. In many cases host-passthrough is performing better, but there are exceptions.

In addition, there are hypervisor enlightenments (features) that can be turned on. Here is my features section for comparison:

      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vpindex state="on"/>
      <runtime state="on"/>
      <synic state="on"/>
      <stimer state="on">
        <direct state="on"/>
      <reset state="on"/>
      <vendor_id state="on" value="AuthenticAMD"/>
      <frequencies state="on"/>
      <reenlightenment state="on"/>
      <tlbflush state="on"/>
      <ipi state="on"/>
      <evmcs state="off"/>
      <hidden state="on"/>
    <vmport state="off"/>
    <ioapic driver="kvm"/>

In above configuration, you need the section only if you pass through a Nvidia GPU.

Another section that has impact on performance is the timing section (clock):

  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
    <timer name="tsc" present="yes" mode="native"/>

Note the last line.

The above examples are only relevant if you want or need to tweak VM performance. If that is not an issue, leave as is and be happy.

I’m glade it is now working for you.

If you still interested in why DNS is not working, do you use systemd-resolved with the stub resolver? Because libvirt starts a dnsmasq process that needs to listen on, but port 53 might be taken for all addresses by systemd-resolved.

1 Like

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