我有一个带有 KVM (qemu) 的 Windows 10 VM 设置。我正在通过鼠标和键盘输入。我在下面查找了设备/dev/input/by-id/
并将它们添加到 XML 中:
<input type="mouse" bus="virtio">
<address type="pci" domain="0x0000" bus="0x0b" slot="0x00" function="0x0"/>
</input>
<input type="keyboard" bus="virtio">
<address type="pci" domain="0x0000" bus="0x0c" slot="0x00" function="0x0"/>
</input>
<input type="mouse" bus="ps2"/>
<input type="keyboard" bus="ps2"/>
<qemu:commandline>
<qemu:arg value="-object"/>
<qemu:arg value="input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Razer_Razer_DeathAdder_Elite-event-mouse"/>
<qemu:arg value="-object"/>
<qemu:arg value="input-linux,id=kbd1,evdev=/dev/input/by-id/usb-Gaming_KB_Gaming_KB-event-kbd,grab_all=on,repeat=on"/>
</qemu:commandline>
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Gaming_KB_Gaming_KB-event-if01 -> ../event4
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Gaming_KB_Gaming_KB-event-kbd -> ../event2
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Gaming_KB_Gaming_KB-if01-event-kbd -> ../event5
lrwxrwxrwx 1 root root 10 Sep 7 08:26 usb-Razer_Razer_DeathAdder_Elite-event-if01 -> ../event10
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Razer_Razer_DeathAdder_Elite-event-mouse -> ../event6
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Razer_Razer_DeathAdder_Elite-if01-event-kbd -> ../event7
lrwxrwxrwx 1 root root 10 Sep 7 08:26 usb-Razer_Razer_DeathAdder_Elite-if02-event-kbd -> ../event11
lrwxrwxrwx 1 root root 9 Sep 7 08:26 usb-Razer_Razer_DeathAdder_Elite-mouse -> ../mouse0
除了鼠标按钮 4 和 5 之外,所有输入都工作得很好。有时,在虚拟机重新启动未定义的次数后,它们会工作。如何让鼠标按钮 4 和 5 在虚拟机上正常工作?