<div dir="ltr"><div>Hi,</div><div><br></div><div>Another approach is via events.</div><div><domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0">http://libvirt.org/schemas/domain/qemu/1.0</a>'></div><div>...<br></div><div></div><div>  <qemu:commandline><br>    <qemu:arg value='-object'/><br>    <qemu:arg value='input-linux,id=mouse1,evdev=/dev/input/by-id/usb-Microsoft_Microsoft_5-Button_Mouse_with_IntelliEye_TM_-event-mouse'/><br>    <qemu:arg value='-object'/><br>    <qemu:arg value='input-linux,id=kbd1,evdev=/dev/input/by-id/usb-DELL_DELL_USB_Keyboard-event-kbd,grab_all=on,repeat=on'/><br>  </qemu:commandline></div><div></domain></div><div><br></div><div>You will need to edit the above to match your specific keyboard and mouse.</div><div><br></div><div>You then press left-CTRL and right-CTRL at the same time to switch mouse/key control between VM and not.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 10 Jun 2019 at 05:45, Acewind <<a href="mailto:acewind@gmail.com">acewind@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">My Enviroment:<br>OS: Ubuntu 18.04<br>Kernel: 4.15.0-51-generic<br>SeaBIOS: 1.10.2-1ubuntu1<div><br>I have successfully run an Win7 libvirt instance on Intel i3-7130U Ubuntu 18.04 host with IGD card passthrough by VFIO in legacy mode. </div><div><br></div><div>Aslo I need to passthrough the USB mouse and keyboard to the Windows VM. I tried passthrough only mouse/keyboard device with:</div><div><br></div><div>    <hostdev mode='subsystem' type='usb' managed='yes'><br>      <source><br>        <vendor id='0x1c4f'/><br>        <product id='0x0002'/><br>        <address bus='1' device='3'/><br>      </source><br>      <alias name='hostdev5'/><br>      <address type='usb' bus='0' port='1'/><br>    </hostdev><br>    <hostdev mode='subsystem' type='usb' managed='yes'><br>      <source><br>        <vendor id='0x093a'/><br>        <product id='0x2521'/><br>        <address bus='1' device='2'/><br>      </source><br>      <alias name='hostdev6'/><br>      <address type='usb' bus='0' port='2'/><br>    </hostdev><br></div><div><br></div><div><br>And also tried to passthrough whole xhci usb controller to Windows VM with:</div><div><br></div><div><hostdev mode='subsystem' type='pci' managed='no'><br>      <driver name='vfio'/><br>      <source><br>        <address domain='0x0000' bus='0x00' slot='0x14' function='0x0'/><br>      </source><br>      <alias name='hostdev5'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/><br></hostdev><br><hostdev mode='subsystem' type='pci' managed='no'><br>      <driver name='vfio'/><br>      <source><br>        <address domain='0x0000' bus='0x00' slot='0x14' function='0x2'/><br>      </source><br>      <alias name='hostdev6'/><br>      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/><br></hostdev><br></div><div><br></div><div><br>But there're same problems that after Windows powered on with mouse cursor displayed on the screen, I need to wait for 5~10 seconds to move the mouse cursor and use the keyboard shortcut keys. </div><div><br></div><div>It seems that USB mouse/keyboard only can be used after USB mouse/keyboard drivers are loaded in Windows VM? Or the qemu SeaBIOS does not support USB mouse/keyboard?</div><div><br></div><div>The qemu commandline part of my libvirt.xml:</div><div><br></div><div>  <qemu:commandline><br>    <qemu:arg value='-set'/><br>    <qemu:arg value='device.hostdev0.x-igd-opregion=on'/><br>    <qemu:arg value='-set'/><br>    <qemu:arg value='device.hostdev0.x-igd-gms=1'/><br>    <qemu:arg value='-bios'/><br>    <qemu:arg value='/usr/share/seabios/bios.bin'/><br>    <qemu:arg value='-chardev'/><br>    <qemu:arg value='file,id=seabios,path=/tmp/bios.log'/><br>    <qemu:arg value='-device'/><br>    <qemu:arg value='isa-debugcon,iobase=0x402,chardev=seabios'/><br>  </qemu:commandline><br></div><div><br></div></div>
_______________________________________________<br>
vfio-users mailing list<br>
<a href="mailto:vfio-users@redhat.com" target="_blank">vfio-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/vfio-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/vfio-users</a><br>
</blockquote></div>