You are not logged in.

#1 2023-12-06 16:14:54

ricciolino
Member
Registered: 2023-12-06
Posts: 6

[SOLVED] Proper USB Mouse passthrough on QEMU KVM

[This post has been solved in post #5]

Hi guys,

I am using this command to launch my Windows 10 guest virtual machine (I am virtualizing the physical Windows 10 partition of my SSD using /dev/md0 RAID virtual disk):

qemu-system-x86_64 -name "Windows 10" -enable-kvm \
    -m 14G \
    -cpu host,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time \
    -smp sockets=1,cores=6,threads=4 \
    -bios /usr/share/OVMF/OVMF_CODE.fd \
    -drive file=/dev/md0,media=disk,format=raw,if=virtio,aio=native,cache=none \
    -mem-path /dev/hugepages \
    -vga virtio \
    -display gtk,window-close=off,grab-on-hover=on,zoom-to-fit=on \
    -device qemu-xhci,id=xhci \
    -device virtio-tablet,wheel-axis=true \
    -monitor unix:/tmp/monitor.sock,server,nowait \
    -device virtio-serial,packed=on,ioeventfd=on \
    -device virtserialport,name=com.redhat.spice.0,chardev=vdagent0 \
    -chardev qemu-vdagent,id=vdagent0,name=vdagent,clipboard=on,mouse=off \
    -nic user,model=virtio-net-pci \
    -device virtio-balloon \
    -device ich9-intel-hda -device hda-output,audiodev=hda -audiodev pa,id=hda,server=unix:/run/user/1000/pulse/native,out.buffer-length=8000,timer-period=1000,out.frequency=44100

What I needed is to force USB mouse pass-through to Windows 10 guest for making use of a proprietary SW of the mouse vendor (this is the mouse).

I tried to change the line

-device virtio-tablet,wheel-axis=true \

with this line...

-device usb-host,vendorid=0x04d9,productid=0xfc49 \

...for passing the real USB device (checking vid and pid with

lsusb

command).

But I am getting a popup from the Redragon SW saying that it is not able to detect my mouse in the virtualized Windows 10 guest.
The popup is similar to this ⬇️

FluxBB bbcode test

⚠️ Note ⚠️
I noticed that if I used VirtualBox with another Windows 10 Guest (virtualized system) and adding a USB filter for the USB mouse the software is able to correctly detect the mouse inside the guest OS, so there must be some way to proper pass the device also inside the QEMU environment.

Last edited by ricciolino (2023-12-07 08:21:34)

Offline

#2 2023-12-06 17:24:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,930

Re: [SOLVED] Proper USB Mouse passthrough on QEMU KVM

You need to set a few more things to make that work, read https://wiki.archlinux.org/title/QEMU#P … USB_device .

Welcome to archlinux forums


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-12-06 17:48:48

ricciolino
Member
Registered: 2023-12-06
Posts: 6

Re: [SOLVED] Proper USB Mouse passthrough on QEMU KVM

Lone_Wolf wrote:

Welcome to archlinux forums

Thank you smile

Lone_Wolf wrote:

You need to set a few more things to make that work, read https://wiki.archlinux.org/title/QEMU#P … USB_device .

I followed exactly that section, but I can't understand what am I missing, could you please clarify to me?

Offline

#4 2023-12-06 18:02:47

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,280
Website

Re: [SOLVED] Proper USB Mouse passthrough on QEMU KVM

Looks like you're missing the bus identifier.


Para todos todo, para nosotros nada

Offline

#5 2023-12-07 08:18:46

ricciolino
Member
Registered: 2023-12-06
Posts: 6

Re: [SOLVED] Proper USB Mouse passthrough on QEMU KVM

Head_on_a_Stick wrote:

Looks like you're missing the bus identifier.

Are you meaning the bus=controller_id.0 in this ⬇️ generic syntax ?

-device usb-host,bus=controller_id.0,vendorid=0xvendor_id,productid=0xproduct_id

I already tried to apply it to my command without any success sad

In the wiki page, examples only refer to bus=ehci.0 identifiers, that probably it is not right for my case, how can I understand the right bus identifier for my USB mouse?

Anyway... I was able to solve this issue! smile

I just tried to use this syntax

-device usb-host,hostdevice=/dev/bus/usb/001/005

and this way my USB mouse is detected in the Redragon SW !

Thanks for the support guys!

Last edited by ricciolino (2023-12-07 08:22:19)

Offline

Board footer

Powered by FluxBB