主机:Ubuntu 18.04
来宾:Fedora 33
virt-manager 1.5.1
我使用 virt-manager 构建了 guest 虚拟机。
访客工作:互联网访问工作、浏览器中的 YouTube 工作、声音工作、访客和主机之间的剪贴板共享工作。
问题总结:
但是,自动调整显示大小不起作用。
并且主机文件共享不起作用。
我在任何日志文件中都找不到任何相关的错误消息。
我如何找出我做错了什么并解决它?
细节:
我的 Fedora 镜像的 Virt-manager 设置包括 QXL、virtio 和 SPICE 通道。
virt-manager 启动的 Spice 窗口允许我(查看菜单)选择自动调整大小,已勾选。
我使用 virsh 编辑 vgamem 并给它 64MB 而不是 16MB:
<video>
<model type='qxl' ram='65536' vram='65536' vgamem='65536' heads='1' primary='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
virt-manager生成的Qemu命令行
qemu-system-x86_64
-enable-kvm
-name guest=Fedora,debug-threads=on
-S
-object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-9-Fedora/master-key.aes
-machine pc-i440fx-bionic,accel=kvm,usb=off,vmport=off,dump-guest-core=off
-cpu Skylake-Client-IBRS
-m <<vm memory>>
-realtime mlock=off
-smp 2,sockets=2,cores=1,threads=1
-uuid <<uid>>
-no-user-config
-nodefaults
-chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain-9-Fedora/monitor.sock,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control
-rtc base=utc,driftfix=slew
-global kvm-pit.lost_tick_policy=delay
-no-hpet
-no-shutdown
-global PIIX4_PM.disable_s3=1
-global PIIX4_PM.disable_s4=1
-boot strict=on
-device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7
-device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6
-drive file=/data/Fedora.qcow2,format=qcow2,if=none,id=drive-ide0-0-0
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1
-drive if=none,id=drive-ide0-0-1,readonly=on
-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1
-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/data
-device virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=/data,bus=pci.0,addr=0x8
-netdev tap,fd=28,id=hostnet0
-device rtl8139,netdev=hostnet0,id=net0,mac=<<my MAC address>>,bus=pci.0,addr=0x3
-chardev pty,id=charserial0
-device isa-serial,chardev=charserial0,id=serial0
-chardev spicevmc,id=charchannel0,name=vdagent
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0
-spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=64,max_outputs=1,bus=pci.0,addr=0x2
-device intel-hda,id=sound0,bus=pci.0,addr=0x4
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0
-chardev spicevmc,id=charredir0,name=usbredir
-device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=1
-chardev spicevmc,id=charredir1,name=usbredir
-device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=2
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7
-msg timestamp=on
在客人身上,fgrep -R vdagent /var/log
出现了几行,但没有任何一行对我来说意味着错误或问题。
对客人来说,fgrep -R /data /var/log
没有发现任何有用的东西。/data
是我在主机上的共享和来宾上的预期安装点。我mkdir /data; chmod 777 /data; reboot
检查了一下,之前和之后都是同样的问题。
在来宾上,该服务正在运行:
systemctl status spice-vdagentd
● spice-vdagentd.service - Agent daemon for Spice guests
Loaded: loaded (/usr/lib/systemd/system/spice-vdagentd.service; indirect; vendor preset: enabled)
Active: active (running) since Thu 2020-12-17 17:39:14 GMT; 5h 39min ago
TriggeredBy: ● spice-vdagentd.socket
Process: 1383 ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS (code=exited, status=0/SUCCESS)
Main PID: 1385 (spice-vdagentd)
Tasks: 3 (limit: 19158)
Memory: 4.2M
CPU: 407ms
CGroup: /system.slice/spice-vdagentd.service
└─1385 /usr/sbin/spice-vdagentd
Dec 17 17:39:14 localhost.localdomain systemd[1]: Starting Agent daemon for Spice guests...
Dec 17 17:39:14 localhost.localdomain systemd[1]: spice-vdagentd.service: Can't open PID file /run/spice-vdagentd/spice-vdagentd.pid (yet?) after start: Oper>
Dec 17 17:39:14 localhost.localdomain systemd[1]: Started Agent daemon for Spice guests.
Dec 17 17:39:14 localhost.localdomain spice-vdagentd[1385]: opening vdagent virtio channel
Dec 17 17:39:14 localhost.localdomain spice-vdagentd[1385]: Set max clipboard: 104857600
Dec 17 17:39:14 localhost.localdomain spice-vdagentd[1385]: Set max clipboard: 104857600
Dec 17 22:57:01 localhost.localdomain spice-vdagentd[1385]: closed vdagent virtio channel
Dec 17 22:57:04 localhost.localdomain spice-vdagentd[1385]: opening vdagent virtio channel
Dec 17 22:57:04 localhost.localdomain spice-vdagentd[1385]: Set max clipboard: 104857600
Dec 17 22:57:04 localhost.localdomain spice-vdagentd[1385]: Set max clipboard: 104857600
主机上的 libvirt 日志也没有显示任何特别的内容:
2020-12-17 17:32:24.311+0000: starting up libvirt version: 4.0.0, package: 1ubuntu8.17 (Marc Deslauriers <[email protected]> Wed, 06 May 2020 14:18:23 -0400), qemu version: 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.34), hostname: asm4
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin QEMU_AUDIO_DRV=spice /usr/bin/kvm-spice -name guest=Fedora,<<... same arguments as above>>
2020-12-17T17:32:24.355739Z qemu-system-x86_64: -chardev pty,id=charserial0: char device redirected to /dev/pts/20 (label charserial0)
main_channel_link: add main channel client
red_qxl_set_cursor_peer:
inputs_connect: inputs channel client create
main_channel_handle_message: agent start
main_channel_handle_message: agent start
main_channel_handle_message: agent start
main_channel_handle_message: agent start
main_channel_handle_message: agent start
main_channel_handle_message: agent start