Speed of VM

Hello!

I’ve been fiddling around with VM’s recently. I’m not really interested in passthrough solutions, because I only have one video card at the moment. My main OS is Manjaro, latest version. Using QEMU with Virtual Machine Manager, as I’m not that much of a power user (still interested in learning though!).

I’ve had a macOSX VM for fun, and a Windows 10 VM to do actual work, since I need access to certain Windows apps, but want to keep Linux as my main OS.

A few days ago, I’ve created a Ubuntu 20.04 VM. I am completely amazed how fast it is, there is no input delay whatsoever. It’s as if the Ubuntu VM was in fact my main OS, in a window.

I was wondering if some of you gurus could help me understand why that is, and is it possible to obtain the same kind of responsiveness with my Windows 10 VM. Any ideas? Is that something that needs to be implemented by Microsoft in the VM itself?

Thanks in advance!

I wish I could help but I currently use Windows 10 Pro as my host OS and then running VMware Player to run another Windows 10 Pro guest machine.

However I don’t use any passthrough either and just the built in VMware graphics drivers.

Everything seems to be working just fine.

I allocated 8 CPU cores and 16GB of RAM to the VM and it just goes about it’s business like a normal desktop.

Have you installed VirtIO drivers inside the windows vm?
From my experience, you can get a reasonably responsive windows vm under kvm, even on older hardware. In the case of Ubuntu vm, the required kernel modules are already included and automatically detected, you don’t have to do anything.
And for the display virtual device that you assigned to the vm, if I remember correctly, you had two protocol options, either vnc or spice, and I think spice is faster.

2 Likes

Have you tried connecting to the windows 10 VM via remote desktop? Enable access on the Windows VM and then connect to it via its IP or hostname. Install Remmina on Manjaro with the appropriate RDP package to do so :slight_smile:

Also be sure to toggle dynamic resolution for seamless fullscreen.

I have 8 threads and 8 GB of RAM allocated, have 12 and 32 physically, so that’s not the issue. Thanks for the answer though :slight_smile:

Nice, so this shouldn’t be the issue.

Maybe try the other tips that have been posted ?

Thanks! VirtIO will certainly help. I found a guide on the net that suggests installing the drivers right from the installation process. Do you think I will be able to get the same results if I keep my already installed version?

I’m trying as I am writing this though. The NIC is already switched and seems to be active on VirtIO. Gonna try the disk now.

However, I think the problem is mostly the video display driver. I see there is a thing called Channel qemu-ga in the Ubuntu VM that was created automatically. I added it to the W10 VM.

Doesn’t seem to fix the problem.

To be clear, it’s like I’m on 30 hz refresh rate on the W10 VM, as opposed to full 60 hz on the Ubuntu VM.

Thanks again for the answer!

You’re the boss Hossam!

That was it, I actually had to update the display adapter drivers with the VirtIO drivers as well. Now works just as snappy. Thanks a lot!!!

You are most welcome dear :slight_smile:

I will try that option as well Neurot1ka, thanks for the tip.

The input is really snappy, but I can’t say the visuals are top notch with the VirtIO and Spice combination. Will provide feedback when I get time to try that.

Hi.

I am currently faced with the same problem, but I am unable to update my drivers for my Windows 10 guest. I tried many (but likely not all) subfolders of the current stable VirtIO ISO as well as the whole Drive when Updating the driver for my Display Adapter, but it always tells me that the currently best driver is installed with the Microsoft Basic Display Adapter.

Where is the driver located on the Iso that helped with the performance?

My Video adapter is currently set to VirtIO with enabled 3C acceleration. I hope my explaination suffices so far =/

Full KVM spec
<domain type="kvm">
  <name>win10-05</name>
  <uuid>myuuid</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">8388608</memory>
  <currentMemory unit="KiB">8388608</currentMemory>
  <vcpu placement="static">6</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-4.2">hvm</type>
    <bootmenu enable="yes"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-model" check="partial">
    <topology sockets="1" cores="3" threads="2"/>
  </cpu>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/win10-05.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <boot order="2"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/pathto/en_windows_10_consumer_editions_version_2004_x64_dvd_36d61c40.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
      <boot order="1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/home/mlw/images/virtio-win-0.1.185.iso"/>
      <target dev="sdc" bus="sata"/>
      <readonly/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <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>
    <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>
    <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>
    <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>
    <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>
    <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>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <interface type="direct">
      <mac address="52:54:00:6d:8b:93"/>
      <source dev="enp6s0" mode="bridge"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
    </graphics>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <video>
      <model type="virtio" heads="1" primary="yes">
        <acceleration accel3d="yes"/>
      </model>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
    </redirdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
</domain>

Mount the virtio driver ISO, and run this in powershell as an administrator then reboot the guest:

Get-ChildItem "d:\" -Recurse -Filter "*.inf" | 
ForEach-Object { PNPUtil.exe /add-driver $_.FullName /install }

(assuming your virtual CD/DVD drive is D)

This will bulk add all drivers under the path specified to the OS, which can then evaluate which ones match the virtual hardware/OS combination you have installed.

Thank you thro, the command works like a charm.
Unfortunatly it did not fix my issues, despite now installing drivers. I suspect the root of the problem to lie on my host (RX580 and can’T get opencl to work as well as other weird stuff), so I gotta check on this.