Wondering if anyone has had luck passing through the 8BitDo wireless USB controller (xbox 2.4 ghz version) in QEMU. I can pas through the dongle in an IDLE status, but installing it under windows requires plugging it in, and when you try to pass through the plugged in controller and start your VM the controller power cycles and the VM won’t startup as it sees missing hardware.
I am trying the same thing but I can’t even get the controller to show up in the windows 10 VM.
Use a script to automatically attach VM on device connect based on device path, e.g. this
This is needed so when a device is power cycled, it is rebind to the VM immediately. I’m using this script to do firmware upgrades, etc. on my 8BitDo Ultimate (2.4GHz).
The 2.4GHz dongle should work as-is without installing any extra drivers. It just needs to be in a game to not get auto-sleep.
Sweet! That is exactly the reason why I’m trying to get this working. I’ll read that script to see how it works but from a quick glance it seems that the USB device is already loaded in the linux host and needs to be disconnected there and then reconnected to the vm? I figured aqemu/qemu would do that for me but that’s maybe me being used to virtualbox too much.
Thanks!
In this particular case, I don’t think the driver on the Linux side has anything to do with it at all. QEMU does disconnect the device from the host for you, it’s just that QEMU (and Libvirt) doesn’t automatically reconnect a USB device if it’s disconnected from the host (e.g. power cycle) which can happen quite a lot.
For example, when doing firmware updates (or reconfiguring the device in some cases), it usually requires the device to be switched from HID mode into a DFU mode, which requires a power cycle. This causes the device to be disconnected from the host, and as mentioned earlier, won’t be automatically reconnected. (You could manually reconnect the device again, but oftenly there are timeouts, or need to power cycle 2–3 times to finish reconfiguring, etc.)
In the case of the 8BitDo Ultimate, it has this power saving feature where if there’s nothing using the device, it’ll automatically turn itself off (which disconnect itself from the host). Using the script to automatically bind the device based on device path is better in this case, as it allows a true plug and play as long as you don’t relocate USB ports.
What the script does is you can configure it to have udev trigger the script with device path on device attach, of which the script will generate the Libvirt XML on the fly and attach the device to a running VM. If you’re using QEMU without Libvirt, then some modification will be necessary (e.g. make it use QEMU -monitor
socket instead of virsh).
I’m running my 8BitDo Ultimate with a PC connected to a controller dock, with a 2.4GHz dongle connected to the dock itself. I have not needed to do any manual pairing in my setup (it is bind to the VM and detected on Windows as soon as I remove the controller from the Dock).
Then it seems I will need to take some steps back to even get the controller recognized by Windows in the first place. Maybe I should not be using aqemu and just use qemu to get a better grip of what every option does.
I don’t have enough time to properly read through the thread, so I hope this is relevant…
I once passed through an Xbox controller to a vm, I had to install the Linux driver in proxmox first, so it could properly recognize the device and then properly pass it over to the windows VM. I could have been mistaken about my pathology, but no other combination seemed to work.