5

I'm a KVM newbie and I'm experiencing poor graphic performance.

Host: Asus UX305FA with mini Ubuntu 17.10 with i3 window manager.

Guest 1: Windows 10

Here is the content of win10.xml:

<domain type='kvm'>
  <name>win10</name>
  <uuid>efd921e8-a8d9-4b22-8ada-3dd81afef678</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-artful'>hvm</type>
    <boot dev='hd'/>
  </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'>
    <model fallback='allow'/>
  </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>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/windata/KVM/Windows10slim.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/windata/KVM/virtio-win-0.1.141.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:e5:34:ca'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </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='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 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='0x00' slot='0x07' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Guest 2: Lubuntu 17.10

Here is the content of lubuntu.xml:

<domain type='kvm'>
  <name>lubuntu</name>
  <uuid>077f9473-9834-472f-95e2-a101fb8e2867</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-artful'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>Broadwell-noTSX</model>
  </cpu>
  <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>restart</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/lubuntu.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:f9:dc:35'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </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='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 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='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

As a display I use Spice and video is set to QXL. I installed the Spice agent/client in both guests.

The poor performances are pretty the same with the 2 guests. The experience is laggy and if I play a youtube video it has a lot of tearing. Also the resolution doesn't change automatically based on guest windows size.

In the same host, if I run a Win10 VM in Virtualbox I have much better graphic performances and automatic resolution based on guest window works.

What could I try to improve the graphic perfomances?

Update: as suggested by @byte-commander, I made a new VM with Debian 9. In this case the automatic resolution works but the graphic performances are still poor.

Guest 3: Debian 9 Here is the content of debian9.xml:

<domain type='kvm'>
<name>debian9</name>
<uuid>ca3ffe36-f956-4d7a-8dca-f8bd9fba123b</uuid>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
    <type arch='x86_64' machine='pc-i440fx-artful'>hvm</type>
    <boot dev='hd'/>
</os>
<features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
</features>
<cpu mode='custom' match='exact' check='partial'>
    <model fallback='allow'>Broadwell-noTSX</model>
</cpu>
<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>restart</on_crash>
<pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
</pm>
<devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
    <driver name='qemu' type='qcow2'/>
    <source file='/var/lib/libvirt/images/debian9.qcow2'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
    <driver name='qemu' type='raw'/>
    <target dev='hda' bus='ide'/>
    <readonly/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
    <master startport='0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
    <master startport='2'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
    <master startport='4'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </controller>
    <interface type='network'>
    <mac address='52:54:00:54:cd:79'/>
    <source network='default'/>
    <model type='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
    <target port='0'/>
    </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>
    <channel type='spicevmc'>
    <target type='virtio' name='com.redhat.spice.0'/>
    <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </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='127.0.0.1'>
    <listen type='address' address='127.0.0.1'/>
    </graphics>
    <sound model='ich6'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
    <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 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='0x00' slot='0x08' function='0x0'/>
    </memballoon>
</devices>
</domain>

Update 2: output of inxi added and increased RAM of Debian VM to 2GB.

Host inxi -Fxz:

System:    Host: leaf Kernel: 4.15.0-041500-generic x86_64 bits: 64 gcc: 7.2.0 Desktop: i3 4.13
        Distro: Ubuntu 17.10
Machine:   Device: laptop System: ASUSTeK product: UX305FA v: 1.0 serial: N/A
        Mobo: ASUSTeK model: UX305FA v: 1.0 serial: N/A
        UEFI [Legacy]: American Megatrends v: UX305FA.213 date: 10/12/2015
Battery    BAT0: charge: 37.6 Wh 95.6% condition: 39.3/45.0 Wh (87%) model: ASUSTeK ASUS status: Discharging
CPU:       Dual core Intel Core M-5Y10c (-HT-MCP-) arch: Broadwell rev.4 cache: 4096 KB
        flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 3990
        clock speeds: max: 2000 MHz 1: 802 MHz 2: 798 MHz 3: 798 MHz 4: 798 MHz
Graphics:  Card: Intel HD Graphics 5300 bus-ID: 00:02.0
        Display Server: X.Org 1.19.5 drivers: modesetting (unloaded: fbdev,vesa)
        Resolution: [email protected], [email protected]
        OpenGL: renderer: Mesa DRI Intel HD Graphics 5300 (Broadwell GT2)
        version: 4.5 Mesa 17.2.8 Direct Render: Yes
Audio:     Card-1 Intel Wildcat Point-LP High Definition Audio Controller driver: snd_hda_intel bus-ID: 00:1b.0
        Card-2 Intel Broadwell-U Audio Controller driver: snd_hda_intel bus-ID: 00:03.0
        Card-3 Blue Microphones Yeti Stereo Microphone driver: USB Audio usb-ID: 001-021
        Sound: Advanced Linux Sound Architecture v: k4.15.0-041500-generic
Network:   Card: Intel Wireless 7265 driver: iwlwifi bus-ID: 02:00.0
        IF: wlp2s0 state: up mac: <filter>
Drives:    HDD Total Size: 384.1GB (49.1% used)
        ID-1: /dev/sda model: Micron_M600_MTFD size: 256.1GB temp: 39C
        ID-2: /dev/sdb model: Name n/a size: 128.0GB temp: 0C
Partition: ID-1: / size: 40G used: 21G (55%) fs: ext4 dev: /dev/sda7
        ID-2: swap-1 size: 16.97GB used: 0.61GB (4%) fs: swap dev: /dev/sda6
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 44.0C mobo: 27.8C
        Fan Speeds (in rpm): cpu: 25500
Info:      Processes: 238 Uptime: 13:58 Memory: 4391.3/7877.2MB Init: systemd runlevel: 5 Gcc sys: 7.2.0
        Client: Shell (bash 4.4.121) inxi: 2.3.37 

Guest Debian 9 inxi -Fxz:

System:    Host: debian Kernel: 4.9.0-6-amd64 x86_64 (64 bit gcc: 6.3.0) Desktop: Gnome 3.22.3 (Gtk 3.22.11-1)
        Distro: Debian GNU/Linux 9 (stretch)
Machine:   Device: qemu System: QEMU product: Standard PC (i440FX + PIIX 1996) v: pc-i440fx-artful
        Mobo: N/A model: N/A BIOS: Sea v: 1.10.2-1ubuntu1 date: 04/01/2014
CPU(s):    2 Single core Intel Core (Broadwell no TSX)s (-HT-SMP-) cache: 32768 KB
        flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3) bmips: 3990
        clock speeds: max: 997 MHz 1: 997 MHz 2: 997 MHz
Graphics:  Card: Red Hat QXL paravirtual graphic card bus-ID: 00:02.0
        Display Server: X.org 1.19.2 driver: N/A tty size: 211x54 Advanced Data: N/A for root
Audio:     Card Intel 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller
        driver: snd_hda_intel bus-ID: 00:04.0
        Sound: Advanced Linux Sound Architecture v: k4.9.0-6-amd64
Network:   Card: Red Hat Virtio network device driver: virtio-pci v: 1 port: c0a0 bus-ID: 00:03.0
        IF: ens3 state: up speed: -1 duplex: unknown mac: <filter>
Drives:    HDD Total Size: 10.7GB (51.0% used)
        ID-1: /dev/vda model: N/A size: 10.7GB
Partition: ID-1: / size: 8.8G used: 4.2G (50%) fs: ext4 dev: /dev/vda1
        ID-2: swap-1 size: 1.07GB used: 0.00GB (0%) fs: swap dev: /dev/vda5
Sensors:   None detected - is lm-sensors installed and configured?
Info:      Processes: 156 Uptime: 26 min Memory: 1430.5/2004.2MB Init: systemd runlevel: 5 Gcc sys: N/A
        Client: Shell (bash 4.4.121) inxi: 2.3.5 
5
  • 1
    You could upload the output of virsh dumpxml generic (changing generic to whatever your VMs are called) using pastebinit. People may then be able to make pertinent suggestions.
    – DK Bose
    Mar 13, 2018 at 12:36
  • 3
    Lubuntu's desktop is currently not compatible with the versions of the QXL graphics driver and spice-vdagent packages, which is why auto-resizing doesn't work at all and which probably also explains the otherwise bad performance. According to this German article from August 2017, only the newest versions of Gnome and KDE work well. Maybe try a VM with one of these desktops.
    – Byte Commander
    Mar 13, 2018 at 12:42
  • @byte-commander you're right about the auto-resizing, I tested a Debian 9 guest and it works but unluckily graphic performances are still poor. I updated the question. Mar 13, 2018 at 14:28
  • Is it correct that you've given the VMs 1 GB RAM? How much do you have in total? I know things are working well in VBox so if you've given the same RAM to guests there, it may not be an issue.
    – DK Bose
    Mar 14, 2018 at 2:19
  • The output of inxi -Fxz from both host and guests may offer some clues as well.
    – DK Bose
    Mar 14, 2018 at 2:22

1 Answer 1

0

Upgrading to Ubuntu 18.04 solved the poor graphic performances.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .