Extra mouse buttons not working in virtualization (VMware/VirtualBox, ubuntu host)

Possible workaround:

After editing the VM's .vmx file to add

mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
usb.generic.allowHID = "TRUE"

you'll be able to use your five-button mouse in the VM. To do so, open your VM, then navigate to Virtual Machine > Removable Devices > [Your Mouse] > Connect (Disconnect from Host). You'll get a couple warnings that you won't be able to use your mouse with the host anymore, and just click OK.

Now you can only use your mouse within the VM whether it's full-screen or in windowed mode. Hit Ctrl-G on your keyboard to get rid of the host mouse icon and fully immerse yourself in the VM. Once you need your mouse again outside the VM, hit Ctrl+Alt, then release. Now the focus is back to your host OS. Hold Alt and push V to bring up the Virtual Machine menu, and use your arrow keys to navigate to Virtual Machine > Removable Devices > [Your Mouse] > Disconnect (Connect to Host).

Now everything is back to normal. Hopefully something will change in either Ubuntu or VMWare Player soon to make it easier than this.


To get extra mouse buttons to work under VMware, edit configfile.vmx (append following lines):

mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"

The above settings will enable a virtual vmware mouse with 20 buttons. However, in certain situations vmware is not mapping the mouse event arriving at the host to the correct guest event.

Exactly why it fails to send the correct mouse event is a good question that is not covered.

Start and run the following in the guest os. Run xev | grep -i "button" in a terminal. Move to the spawned window, click the buttons you wanna assign or swap once. xev outputs the registered mouse event, in many cases the extra mouse buttons that should be eg. mouse button 8 or 9 is received as mouse button event 16 or 17.

The reassigning of mouse button events can be done with eg. xinput, the following makes deviceID 8 having mouse button 16 acting as mouse 8, and mouse 17 as mouse 9.

xinput set-button-map 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 9