Best kernel for virtualization?

I run Windows 10 in a virtual machine. Right now I am using VirtualBox but I might switch.
What kernel is best for this? Or does it make any difference?
I am on the default linux kernel.

inxi -F
System:
  Host: shmuel-eos Kernel: 6.9.5-arch1-1 arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.0.5 Distro: EndeavourOS
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B365M-A v: Rev X.0x
    serial: <superuser required> UEFI: American Megatrends v: 2208
    date: 07/09/2021
Battery:
  ID-1: hidpp_battery_0 charge: 91% condition: N/A
CPU:
  Info: 8-core model: Intel Core i7-9700 bits: 64 type: MCP cache: L2: 2 MiB
  Speed (MHz): avg: 4500 min/max: 800/4700 cores: 1: 4501 2: 4501 3: 4497
    4: 4500 5: 4500 6: 4501 7: 4500 8: 4500
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] driver: i915 v: kernel
  Device-2: USB C Video Adaptor driver: N/A type: USB
  Device-3: Microdia USB Live camera driver: snd-usb-audio,uvcvideo
    type: USB
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.0
    compositor: kwin_wayland driver: X: loaded: modesetting dri: iris gpu: i915
    resolution: 1: 1920x1080 2: 1920x1080
  API: EGL v: 1.5 drivers: iris,swrast
    platforms: wayland,x11,surfaceless,device
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 24.1.1-arch1.1
    renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
  API: Vulkan Message: No Vulkan data available.
Audio:
  Device-1: Intel 200 Series PCH HD Audio driver: snd_hda_intel
  Device-2: Microdia USB Live camera driver: snd-usb-audio,uvcvideo
    type: USB
  API: ALSA v: k6.9.5-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.0.7 status: active
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: a8:5e:45:e2:87:3c
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
  IF: enp0s20f0u3u1 state: down mac: 00:e0:4c:68:51:92
Bluetooth:
  Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) driver: btusb
    type: USB
  Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: disabled
    rfk-block: hardware: no software: no address: N/A
Drives:
  Local Storage: total: 2.26 TiB used: 938.59 GiB (40.6%)
  ID-1: /dev/sda vendor: Kingston model: SA400S37480G size: 447.13 GiB
  ID-2: /dev/sdb vendor: Toshiba model: HDWD120 size: 1.82 TiB
Partition:
  ID-1: / size: 198.11 GiB used: 86.59 GiB (43.7%) fs: ext4 dev: /dev/sda5
  ID-2: /boot/efi size: 96 MiB used: 50 MiB (52.1%) fs: vfat dev: /dev/sda1
Swap:
  ID-1: swap-1 type: zram size: 7.74 GiB used: 1024 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 43.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB available: 15.49 GiB used: 10.84 GiB (70.0%)
  Processes: 265 Uptime: 8h 40m Shell: Bash inxi: 3.3.34

You’ll have better performance if you use Qemu/KVM for running virtual machines than with VirtualBox.

3 Likes

Thanks. I have an issue with virt-manager: I can’t get the VM on the right resolution. I do adjust the resolution in the VM itself, in the Windows display settings, but the optimum resolution is not one of the choices. So either part of the display is cut off, or part of my screen is not utilized.
I have spice installed in the VM, so I am using that.
I tried to install virtio in the VM, but it failed, even with the latest build of virtio. The virtio driver cannot start.

You will probably have to install the Windows Virtio drivers to get full resolution in your Windows vm with virt-manager.

https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Windows_OS_Support

I read past the part that you had already tried that, nvm. Did you have the “Virtio” under “Video Virtio” selected when having installed the virt-win drivers. Last time I installed a Windows vm I did it like that and I had full resolution if I remembered correctly but it’s been a while.

Wonder why virtio didn’t work for me. Maybe I need to disable or uninstall spice in the VM, in order to install virtio in the VM?

I’m just download a Windows 11 iso and will install it in a vm to see what happens now, although I am not using Arch Linux it shouldn’t make a difference.

I will have to try that.

It worked fine for me.

I used the latest virtio-win-xxx-.iso from here to install the display driver via Device Manager (select the default Display Adapter > right click ‘Update Driver’ and have Windows search the iso in D:) and then running the virtio-win-guest-tools.exe for the other drivers.

1 Like

While I do load some of the VirtIO drivers from the aforementioned ISO (network and storage), my best Windows performance comes from the QXL vGPU and this: https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe. Got a Windows 11 Canary build that runs pretty good.

It still works for me. Although when you create a vm with virt-manager and select the Windows iso it will select QXL by default under “Video Virtio”. Make sure you change that to "Virtio, after which you can install the win-virtio drivers. I just used the latest iso and ran the installer, afterwards I rebooted and I had full resolution available in my Windows vm.

I did that and it installed. Full-screen is good, but when the Virt-manager window is maximised, I still don’t get the right resolution. See screenshot. The display does not expand fully on the left and right.

Can you share a screenshot of the vm settings, specifically what you have under “Video Virtio”? I’m just install a new vm with Windows 10 because my previous vm was a vm with Windows 11.

Video virtio is

<video>
  <model type="virtio" heads="1" primary="yes">
    <acceleration accel3d="no"/>
  </model>
  <alias name="video0"/>
  <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
</video>

The whole thing is

<domain type="kvm">
  <name>win10</name>
  <uuid>bd0c01bd-5e17-453e-84f6-2fa6edcb085b</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">7778304</memory>
  <currentMemory unit="KiB">7778304</currentMemory>
  <memoryBacking>
    <source type="memfd"/>
    <access mode="shared"/>
  </memoryBacking>
  <vcpu placement="static">6</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-9.0">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <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="/home/Virt/win10"/>
      <target dev="sda" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <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="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>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x1a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>
    </controller>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x1b"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>
    </controller>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x1c"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>
    </controller>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x1d"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>
    </controller>
    <controller type="pci" index="15" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="15" port="0x1e"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x6"/>
    </controller>
    <controller type="pci" index="16" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </controller>
    <controller type="usb" index="0" model="piix3-uhci">
      <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <filesystem type="mount" accessmode="passthrough">
      <driver type="virtiofs"/>
      <source dir="/home/shmuel/Downloads"/>
      <target dir="Linux_Downloads"/>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </filesystem>
    <interface type="network">
      <mac address="52:54:00:68:c4:38"/>
      <source network="default"/>
      <model type="e1000e"/>
      <address type="pci" domain="0x0000" bus="0x02" 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"/>
      <gl enable="no"/>
    </graphics>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="spice"/>
    <video>
      <model type="virtio" heads="1" primary="yes">
        <acceleration accel3d="no"/>
      </model>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <watchdog model="itco" action="reset"/>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
</domain>

Unlike @Cphusion, changing the VM graphics setting in virt-manager to Virtio doesn’t work for me. I just have it set to QXL and get correct automatic resolution adjustment in both windowed and full screen mode.

@shmu26 What resolution is your display?

I think @shmu26 was talking about full-screen mode. With QXL I only get 1440p resolution instead of my full resolution of 4k. With QXL there is better switching between full-screen mode and window mode.

So I’m thinking @shmu26 will have to play around with those to drivers. For the QXL driver I had to mount the iso within Windows. Then go to Device Manager, select the display adapter and then browse to the location of my iso “qxldod” for w10/amd64. But either way I am able to get a workable resolution with both of them and not just the unchangeable resolution that @shmu26 is getting currently.

Will be deleting that Windows vm now because I had created it just to test it out for this topic.

Thanks to all for the ideas and help. My issue is not with full-screen. It is with maximized window.
Maybe I am missing a package on my EOS host? I have gnome-boxes, qemu-full and virt-manager. Anything else I need?

I tried boot it up in Gnome Boxes, and it scales correctly out of the box.

1 Like

I’ve been using Gnome Boxes for a while now. I can’t recall any issues at all, scaling or otherwise. My virtual machine of choice.

That is cetainly true when you only consider pure CPU prformance. But when you are using graphics in Windows guests the situation is different. In that case the very best performance for windows guests is with vmware. vmware has a full graphics / 3D acceleration support for window guests and outperformance vrtualbox big time.That it is even sufficient to play certain games. kvm does not have such 3D/graphics support.

kvm is very good when it comes to sharing data with the host resp. mounting host drives in a linux guest. The guests i/o performance in this case is almost native performance. This is the reason why I recently migrate my debian nextcloud from vmare to kvm. The debian guest has now a lot faster access to my photos.

1 Like