You are not logged in.

#1 2024-02-10 03:44:36

user0984379
Member
Registered: 2024-02-10
Posts: 4

[SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Hello, I've been trying to troubleshoot a problem for a while that I've been having with trying to create VMs via virt-manager, which is that the VMs (Kali Linux and Linux Mint) that I have made have abhorrent graphical performance (windows are extremely choppy and slow) and that no sound is outputted from the VM at all. There are also a bunch of other minor miscellaneous errors that occur when running the VM (Eg. both the host and guest mouse cursors rendering at the same time). I have read the QEMU section on the arch wiki and I believe the problem is to do with KVM not being enabled on any of the VMs (At least for the graphical aspect of the issue). I have ran all the tests to see if my host OS supports KVM and all the outputs from these commands return that everything is in order.

'LC_ALL=C lscpu | grep Virtualization'
Virtualization:                     VT-x

'zgrep CONFIG_KVM= /proc/config.gz'
CONFIG_KVM=m

'lsmod | grep kvm'
kvm_intel             425984  6
kvm                  1376256  5 kvm_intel
irqbypass              12288  1 kvm

Yet when I hop into a VM all of the aforementioned problems occur. When I go on my host OS's qemu monitor and type in 'info kvm' I get 'kvm support: disabled' outputted. I have been searching around for a solution to this but to no avail. I've heard that using an nvidia card has something to do with VMs not working properly (?) but I couldn't find any way to fix that if that is true. Is there some sort of dependency that I am missing that would get all of this to work or does the issue have to do with kvm not starting up properly?

Last edited by user0984379 (2024-02-11 18:57:20)

Offline

#2 2024-02-10 12:39:48

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,977

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Please post the output of lspci -k from one of the guest.

Also the xml file created by virtmanager for that guest.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2024-02-10 23:48:39

user0984379
Member
Registered: 2024-02-10
Posts: 4

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Lone_Wolf wrote:

Please post the output of lspci -k from one of the guest.

Also the xml file created by virtmanager for that guest.

00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller
        Subsystem: Red Hat, Inc. QEMU Virtual Machine
00:01.0 VGA compatible controller: Device 1234:1111 (rev 02)
        Subsystem: Red Hat, Inc. Device 1100
        Kernel driver in use: bochs-drm
        Kernel modules: bochs
00:02.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.1 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.2 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.3 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.4 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.5 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.6 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:02.7 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.0 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.1 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.2 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.3 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.4 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:03.5 PCI bridge: Red Hat, Inc. QEMU PCIe Root port
        Subsystem: Red Hat, Inc. QEMU PCIe Root port
        Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
        Subsystem: Red Hat, Inc. QEMU Virtual Machine
        Kernel driver in use: lpc_ich
        Kernel modules: lpc_ich
00:1f.2 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02)
        Subsystem: Red Hat, Inc. QEMU Virtual Machine
        Kernel driver in use: ahci
        Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)
        Subsystem: Red Hat, Inc. QEMU Virtual Machine
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801
01:00.0 Ethernet controller: Red Hat, Inc. Virtio 1.0 network device (rev 01)
        Subsystem: Red Hat, Inc. Virtio 1.0 network device
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci
02:00.0 USB controller: Red Hat, Inc. QEMU XHCI Host Controller (rev 01)
        Subsystem: Red Hat, Inc. QEMU XHCI Host Controller
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci
03:00.0 Communication controller: Red Hat, Inc. Virtio 1.0 console (rev 01)
        Subsystem: Red Hat, Inc. Virtio 1.0 console
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci
04:00.0 SCSI storage controller: Red Hat, Inc. Virtio 1.0 block device (rev 01)
        Subsystem: Red Hat, Inc. Virtio 1.0 block device
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci
05:00.0 Unclassified device [00ff]: Red Hat, Inc. Virtio 1.0 memory balloon (rev 01)
        Subsystem: Red Hat, Inc. Virtio 1.0 memory balloon
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci
06:00.0 Unclassified device [00ff]: Red Hat, Inc. Virtio 1.0 RNG (rev 01)
        Subsystem: Red Hat, Inc. Virtio 1.0 RNG
        Kernel driver in use: virtio-pci
        Kernel modules: virtio_pci

Offline

#4 2024-02-10 23:50:42

user0984379
Member
Registered: 2024-02-10
Posts: 4

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Lone_Wolf wrote:

Please post the output of lspci -k from one of the guest.

Also the xml file created by virtmanager for that guest.

<domain type="kvm">
  <name>kali-linux</name>
  <uuid>8147c116-fff9-4d0d-9d16-bfeb1249c7e6</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://debian.org/debian/11"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">8290304</memory>
  <currentMemory unit="KiB">8290304</currentMemory>
  <vcpu placement="static">4</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-8.2">hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </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" discard="unmap"/>
      <source file="/var/lib/libvirt/images/kali-linux.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <target dev="sda" bus="sata"/>
      <readonly/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </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="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="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>
    <interface type="network">
      <mac address="52:54:00:23:68:3d"/>
      <source network="default"/>
      <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="unix">
      <target type="virtio" name="org.qemu.guest_agent.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="vnc" port="-1" autoport="yes">
      <listen type="address"/>
    </graphics>
    <audio id="1" type="none"/>
    <video>
      <model type="vga" vram="16384" heads="1" primary="yes"/>
      <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="0x05" slot="0x00" function="0x0"/>
    </memballoon>
    <rng model="virtio">
      <backend model="random">/dev/urandom</backend>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </rng>
  </devices>
</domain>

Offline

#5 2024-02-11 12:33:58

cryptearth
Banned
Registered: 2024-02-03
Posts: 74

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Although I don't know much about virtualization issues within (k)vm guests often caused by issues of the host system.
So, a few questions about the host system:

- motherboard (manufacturer, model, bios-version)
- cpu
- ram (model, speed, timings)

Also: Please check if you have IOMMU and Virtualization enabled in your bios.
Also also: Have you selected CSM or regular UEFI boot mode?

Offline

#6 2024-02-11 13:05:28

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,977

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

user0984379, pleaase use [ code ] [ /code ] tags for such output , see https://bbs.archlinux.org/help.php#bbcode for details .

    <video>
      <model type="vga" vram="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>

You're giving the guest a very simple videocard that is useful for terminal output but not much more.
See https://wiki.archlinux.org/title/QEMU#Graphic_card for other options and what drivers they need.

virtmanager should allow you to set the devices, the guest drivers you'll have to install yourself in the guest.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2024-02-11 18:55:07

user0984379
Member
Registered: 2024-02-10
Posts: 4

Re: [SOLVED] VMs created on QEMU/Virt Manager have terrible performance

Lone_Wolf wrote:

user0984379, pleaase use [ code ] [ /code ] tags for such output , see https://bbs.archlinux.org/help.php#bbcode for details .

    <video>
      <model type="vga" vram="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>

You're giving the guest a very simple videocard that is useful for terminal output but not much more.
See https://wiki.archlinux.org/title/QEMU#Graphic_card for other options and what drivers they need.

virtmanager should allow you to set the devices, the guest drivers you'll have to install yourself in the guest.

I tried switching to the virtio video card but it gave some error saying that Virt Manager doesn't support it -
Error changing VM configuration: unsupported configuration: domain configuration does not support video model 'virtio'

I searched around and it turns out that the problem was that I only installed the base package of qemu (qemu) instead of the full package (qemu-full) (What I get for watching a youtube video installation guide). After I had the package installed, I rebooted my system and made a new VM and all of the problems went away. Thank you for your help friend big_smile

Offline

Board footer

Powered by FluxBB