Ooof - multiple displays caused problems with mouse/usb-tablet https://gitlab.com/qemu-project/qemu/-/issues/723
On Fri, Nov 12, 2021 at 11:33 AM John Paul Morrison <jmorri...@bogomips.com> wrote: > Hi > > I'm trying to make sense of how this libvirt configuration is working so > well with the mouse. > > Normally, if I start an OSX guest and connect with Spice the mouse is > captured - you have to click and ctrl-alt to release. > > But when I imported the VM into Virt-manager and connected with Spice the > mouse is now seamless - no clicking/doesn't grab focus/no ctrl-alt. > This is great but seems like magic because I thought Spice required > vdagent and OSX doesn't have this. > Is Qemu guest agent involved with the mouse? This is passed through and > AppleQEMUGuestAgent is running. > > > I built a Catalina guest using quickemu then imported the disks with > virtmanager. I'm using the quickemu ppa version of Qemu 6.0 > > I used this template to import the guest. I added sound(needs correct > OpenCore) and USB redirection which works nicely too. > https://github.com/kholia/OSX-KVM/blob/master/macOS-libvirt-Catalina.xml > > - Does virtmanager/libvirt do anything special here or is it the generated > Qemu config? > > Also "-device usb-tablet" doesn't work properly for me in the > quckemu setup but it works with the libvirt qemu comands > There's a lot going on in the libvirt config - I'm wondering what exactly > makes the mouse work. > > /usr/bin/qemu-system-x86_64 -version > QEMU emulator version 6.0.0 (Debian 1:6.0+dfsg-2expubuntu1~focal1.0) > Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers > > This is the env/cmdline setup by virt-manager: > > LC_ALL=C > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin > HOME=/var/lib/libvirt/qemu/domain--1-macOS > XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-macOS/.local/share > XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-macOS/.cache > XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-macOS/.config > > /usr/bin/qemu-system-x86_64 > -name guest=macOS,debug-threads=on > -object > '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-macOS/master-key.aes"}' > -blockdev > '{"driver":"file","filename":"/home/jmorrison/OSX-KVM/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' > -blockdev > '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' > -blockdev > '{"driver":"file","filename":"/home/jmorrison/OSX-KVM/OVMF_VARS-1024x768.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' > -blockdev > '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' > -machine > pc-q35-4.2,accel=kvm,usb=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram > -cpu > kvm64,vme=on,ssse3=on,sse4.2=on,x2apic=on,popcnt=on,aes=on,xsave=on,avx=on,hypervisor=on,xsaveopt=on,invtsc=on > -m 8192 > -object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":8589934592}' > -overcommit mem-lock=off > -smp 4,sockets=4,cores=1,threads=1 > -uuid 2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 > -no-user-config > -nodefaults > -chardev > socket,id=charmonitor,path=/var/lib/libvirt/qemu/domain--1-macOS/monitor.sock,server=on,wait=off > -mon chardev=charmonitor,id=monitor,mode=control > -rtc base=utc,driftfix=slew > -global kvm-pit.lost_tick_policy=delay > -no-hpet > -no-shutdown > -boot strict=on > -device > pcie-root-port,port=0x8,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x1 > -device pcie-root-port,port=0x9,chassis=2,id=pci.2,bus=pcie.0,addr=0x1.0x1 > -device pcie-root-port,port=0xa,chassis=3,id=pci.3,bus=pcie.0,addr=0x1.0x2 > -device pcie-root-port,port=0xb,chassis=4,id=pci.4,bus=pcie.0,addr=0x1.0x3 > -device pcie-root-port,port=0xc,chassis=5,id=pci.5,bus=pcie.0,addr=0x1.0x4 > -device pcie-root-port,port=0xd,chassis=6,id=pci.6,bus=pcie.0,addr=0x1.0x5 > -device pcie-root-port,port=0xe,chassis=7,id=pci.7,bus=pcie.0,addr=0x1.0x6 > -device pcie-root-port,port=0xf,chassis=8,id=pci.8,bus=pcie.0,addr=0x1.0x7 > -device pcie-pci-bridge,id=pci.9,bus=pci.1,addr=0x0 > -device ich9-usb-ehci1,id=usb,bus=pcie.0,addr=0x7.0x7 > -device > ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pcie.0,multifunction=on,addr=0x7 > -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pcie.0,addr=0x7.0x1 > -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pcie.0,addr=0x7.0x2 > -device virtio-serial-pci,id=virtio-serial0,bus=pci.2,addr=0x0 > -blockdev > '{"driver":"file","filename":"/home/jmorrison/OSX-KVM/OpenCore/OpenCore.qcow2","aio":"threads","node-name":"libvirt-3-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' > -blockdev > '{"node-name":"libvirt-3-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage","backing":null}' > -device > ide-hd,bus=ide.0,drive=libvirt-3-format,id=sata0-0-0,bootindex=2,write-cache=on > -blockdev > '{"driver":"file","filename":"/home/jmorrison/OSX-KVM/RecoveryImage.img","node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' > -blockdev > '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"raw","file":"libvirt-2-storage"}' > -device > ide-hd,bus=ide.2,drive=libvirt-2-format,id=sata0-0-2,bootindex=3,write-cache=on > -blockdev > '{"driver":"file","filename":"/home/jmorrison/OSX-KVM/mac_hdd_ng.img","aio":"threads","node-name":"libvirt-1-storage","cache":{"direct":false,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' > -blockdev > '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage","backing":null}' > -device > virtio-blk-pci,bus=pci.3,addr=0x0,drive=libvirt-1-format,id=virtio-disk0,bootindex=1,write-cache=on > -netdev tap,fd=30,id=hostnet0 > -device > vmxnet3,netdev=hostnet0,id=net0,mac=52:54:00:e6:85:40,bus=pci.9,addr=0x2 > -chardev pty,id=charserial0 > -device isa-serial,chardev=charserial0,id=serial0 > -chardev > socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/domain--1-macOS/org.qemu.guest_agent.0,server=on,wait=off > -device > virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 > -audiodev id=audio1,driver=spice > -spice port=5901,addr=0.0.0.0,disable-ticketing=on,seamless-migration=on > -device VGA,id=video0,vgamem_mb=64,bus=pci.9,addr=0x1 > -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b > -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0,audiodev=audio1 > -device > 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' > -smbios type=2 > -device usb-tablet > -device usb-kbd > -cpu > kvm64,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check > -sandbox > on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny > -msg timestamp=on > >