AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[spice](ubuntu)

Martin Hope
lucidbrot
Asked: 2020-03-25 07:22:59 +0800 CST

如何在 ubuntu 18.04 上为 qemu windows 10 来宾设置动态屏幕大小?

  • 11

我的笔记本电脑上有一个双引导设置:Ubuntu 18.04 和 Windows 10。在 ubuntu 中,我可以在本指南的帮助下使用 qemu 引导到我现有的 Windows 分区。我正在使用的命令是这样的:

sudo qemu-system-x86_64 --enable-kvm -cpu host -smp 8 -m 8192 \
-drive format=raw,file=/dev/nvme0n1,index=1 \
-bios /usr/share/ovmf/OVMF.fd \
-display sdl -vga qxl \
-device qemu-xhci,id=xhci \
-netdev user,id=vmnic,smb=/home/generic/Downloads \
-device virtio-net,netdev=vmnic -cdrom ~/Downloads/virtio-win-0.1.171.iso

最后一行只是安装virtio 驱动程序,所以我很确定我不需要每次都需要它。
第二行确定分区/dev/nvme0n1p1。

该指南提到了 SPICE,这显然对

动态屏幕调整大小,来宾/主机之间的剪贴板等。

我想让虚拟屏幕在调整窗口大小时改变它的大小并调整分辨率。我尝试按照https://www.linux-kvm.org/page/SPICE上的指南进行操作,并意识到这spicec不再是一回事 - 这意味着我无法使用spicec -h 127.0.0.1 -p 5900. Spice 用户手册同意
:

推荐的客户端是 remote-viewer(随 virt-viewer 提供)。
GNOME Boxes 也可以用作 Spice 客户端。
spicec 是一个过时的遗留客户端,spicy 只是一个测试应用程序。

所以我尝试添加-spice port=5900,addr=127.0.0.1,disable-ticketing到我的qemu命令并remote-viewer在spice://127.0.0.1:5009. 这实际上打开了一个香料窗口——所以现在我有两个窗口可以显示我的 win10 客户机。
Spice 窗口在调整大小时反应更好,但它保持相同的分辨率,并在必要时添加白色边框。

问题

如何获得能够很好地适应调整大小的访客系统的无边界视图?
如果这不是一个完全不同的问题:我怎么能只有一个窗口,而不是 qemu 和 spice 窗口?


更多详细信息

当我连接remote-viewer时,它的控制台窗口显示

** (remote-viewer:3066): CRITICAL **: 15:54:52.441: virt_viewer_util_extract_host: assertion 'uri != NULL' failed

qemu输出显示

main_channel_link: add main channel client
main_channel_client_handle_pong: net test: latency 0.110000 ms, bitrate 34711864406 bps (33103.813559 Mbps)
inputs_connect: inputs channel client create
red_qxl_set_cursor_peer:
virtualization qemu spice
  • 2 个回答
  • 13743 Views
Martin Hope
Christian Toffolo
Asked: 2018-03-14 04:30:41 +0800 CST

KVM 客户机图形性能不佳

  • 5

我是KVM新手,我的图形性能很差。

主机:Asus UX305FA,带有迷你 Ubuntu 17.10 和i3窗口管理器。

来宾 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>

作为显示器,我使用Spice,视频设置为 QXL。我在两个客人中都安装了 Spice 代理/客户端。

2位客人的表现不佳。体验很滞后,如果我播放 youtube 视频,它会有很多撕裂。此外,分辨率不会根据来宾窗口大小自动更改。

在同一台主机上,如果我在 Virtualbox 中运行 Win10 虚拟机,我将获得更好的图形性能和基于来宾窗口工作的自动分辨率。

我可以尝试什么来改善图形性能?

更新:正如@byte-commander 所建议的,我用 Debian 9 制作了一个新的虚拟机。在这种情况下,自动分辨率有效,但图形性能仍然很差。

来宾 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: Debian VM的inxi添加和增加 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 
virtualbox performance virtualization kvm spice
  • 1 个回答
  • 1453 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve