0

I want to pass through a USB mouse to virtual machine in VirtualBox. I'm aware that VirtualBox can emulate its own Mouse/Keyboard based on input events from the host system. But that is not what I want. My mouse has configurable keys that can only be configured from a Windows driver. I want to be able to do that from a virtual machine (Windows) and if that works I may also want to try and reverse engineer its protocol for libratbag or something similar.

VirtualBox

So the whole USB device has to be passed through to the virtual machine. I have a second mouse that I can use for my host system.

VirtualBox seems to offer a way to add USB devices. However when I click on the USB icon with the little green plus symbol it tells me "no devices available".

VirtualBox USB Settings

Host

I guess I somehow need to disconnect the mouse from the host's input driver. But I don't exactly know how to do that.

From this question - or more specifically its accepted answer - I found out that you can unbind a HID device from a driver. So I tried the following (My mouse registers two HIDs):

echo -n "0003:258A:1007.0012" > /sys/bus/hid/drivers/hid-generic/unbind
echo -n "0003:258A:1007.0013" > /sys/bus/hid/drivers/hid-generic/unbind

Although I have no clue what it exactly does.

My mouse stopped working after that (sort of expected). But I still couldn't select it in VirtualBox - even after I restarted it.

I'm willing/able to switch to a different Virtualization tool like qemu if that simplifies things. But I guess that this is not the problem. Maybe I need to write a udev rule that prevents it to be detected as HID? But I'm not exactly a udev expert and I don't know what is required to make this work.

0

1 Answer 1

2

Start the Guest OS, Go to Devices -> USB:

enter image description here

Works here out of the box without configuring anything.

From the comment by @Scindix, "Looks like all that was missing is that my user wasn't part of the vboxusers group. Also because I didn't have the extensions pack installed only USB 1.0 was available. Now it works perfectly".

2
  • In my case that list is completely empty: imgur.com/a/5kQ9WaQ
    – Scindix
    Commented Jul 2, 2021 at 15:20
  • 1
    Oh. Nevermind. Looks like all that was missing is that my user wasn't part of the vboxusers group. Also because I didn't have the extensions pack installed only USB 1.0 was available. Now it works perfectly. Thanks. your answer lead me into the right direction.
    – Scindix
    Commented Jul 2, 2021 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .