KVM 客户机图形性能不佳

KVM 客户机图形性能不佳

我是一个虚拟机新手,我的图形性能很差。

主持人华硕UX305FA带有i3窗口管理器的 mini Ubuntu 17.10。

嘉宾 1:Windows 10

以下是 的内容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>

嘉宾 2:Lubuntu 17.10

以下是 的内容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>

作为我使用的显示器香料并且视频设置为 QXL。我在两个客户机上都安装了 Spice 代理/客户端。

2 个客户机的性能都很差。体验很滞后,如果我播放 YouTube 视频,画面会撕裂。此外,分辨率不会根据客户机窗口大小自动更改。

在同一个主机中,如果我在 Virtualbox 中运行 Win10 VM,我将获得更好的图形性能和基于客户窗口的自动分辨率。

我可以尝试什么来提高图形性能?

更新:按照@byte-commander 的建议,我使用 Debian 9 创建了一个新的 VM。在这种情况下,自动分辨率可以工作,但图形性能仍然很差。

嘉宾 3:Debian 9 以下是内容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>

更新 2:inxiDebian VM 的添加和 RAM 增加到 2GB 的输出。

主持人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 

访客 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 

答案1

升级到 Ubuntu 18.04 解决了图形性能不佳的问题。

相关内容