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

36,407

Solution 1

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.

Solution 2

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
Share:
36,407

Related videos on Youtube

mika209
Author by

mika209

Updated on September 18, 2022

Comments

  • mika209
    mika209 over 1 year

    I'm trying to run VMware Workstation and/or VirtualBox on Ubuntu. The virtual machines are working perfectly in both applications, except for the extra mouse buttons (forward/backward). In Ubuntu the mouse buttons are all working.

    Virtualization applications: VMware Workstation 10.0.1, latest VirtualBox

    Ubuntu versions I tested as host: 12.04, 13.10, 14.04 beta

    Guest OS I tested: Windows 7, several Linux OS in live-mode

    Mice I tested (all with side buttons): Logitech M510 (unifying receiver), old Razer Copperhead, no-name-mouse

    I already tried a lot of solutions I found online e.g. changing the mouse-settings in .vmx on VMware WS (mouse.vusb.enable, ...) , changing the input-settings on VMware/VirtualBox, reinstall guest tools on guest OS, ...

    I think it's a problem in Ubuntu and not in the virtualization applications. Does anyone have a solution for this?

  • mika209
    mika209 about 10 years
    Yes, I already tried adding usb.generic.allowHID = "TRUE" to the VMware .vmx settings. After that you can connect the mouse/HIDs directly to the virtual machine. But I think this is more a workaround than a solution..
  • MattSayar
    MattSayar about 10 years
    Agreed. It works if you plan on working exclusively in the VM for a significant period of time, but in the end isn't very user friendly
  • mika209
    mika209 about 10 years
    I already tried this. Unfortunately this did not work.
  • mika209
    mika209 about 10 years
    Yes, I've installed the VMware-Tools in every VM. The .basicmouse = FALSE - settings didn't change anything. But it doesn't work in VirtualBox either. So I still think it's a problem in Ubuntu.
  • Anders F. U. Kiær
    Anders F. U. Kiær about 10 years
    @mika209 can you add the output of the command xinput | grep VMware | awk '{print substr($8,4);}' | xargs -L 1 xinput list to your question or paste.ubuntu.com Run the command on your ubuntu guest, and make sure the above mentioned settings are still present in that virtual machines vmx file.
  • mika209
    mika209 about 10 years
    Okay, to be sure there's no mistake: Ubuntu 13.10 Host (extra mouse buttons working) -> latest VMware Workstation -> Ubuntu 13.10 Guest (with .vusb-settings in .vmx & VMware-Tools installed). Result: Extra mouse buttons not working (mice I tested: see above)! Here is the output of the command you've posted: paste.ubuntu.com/7211311 Thanks for your answer anyway!
  • mika209
    mika209 about 10 years
    If you use Windows 7/8 as host with VMware or VirtualBox the extra mouse buttons are working in many guest-OS. How is that possible?
  • Braiam
    Braiam about 10 years
    @mika209 different implementations. Is just as simple.
  • Anders F. U. Kiær
    Anders F. U. Kiær about 10 years
    mika209: can you run xev | grep -i "button" in a terminal in the Guest OS? Then move to the window, click your mouse forward and back button. Please add the output to your question or to ubuntu pastebin for readability.
  • Braiam
    Braiam about 10 years
    @AndersF.U.Kiær following OP comment here it apparently doesn't work.
  • Anders F. U. Kiær
    Anders F. U. Kiær about 10 years
    @braiam, if you check the timestamps can you easily see that OP did not try the updated answer, nor followed up running the xev. However, i couldn't care less anymore. I reproduced the issue, as i use the same setups with vmware alot. I have now shared the knowledge. If others wanna play a ignorant game, feel free.
  • Angelos Pikoulas
    Angelos Pikoulas over 9 years
    This worked perfectly for me: Windows 7 x64 (Host) + SetPoint 6.65.62 + M705 Logitech Mouse, VMWare 10, Kubuntu 14.04 x64 (guest). I could see the results of xev | grep -i "button" right away the and correct button events 8/9 mapped to back/forward. It works as is on Chrome & Firefox without any other configuration on the linux box.
  • Halsafar
    Halsafar over 8 years
    Windows 10 Host, Ubuntu 14.04 Guest. VMWare 11. Adding those three lines worked for me. Specifically the useBasicMouse line was important. Without it the solution still applies but my mouse was randomly jumping back into the host OS even with the guest in full screen.
  • Devator
    Devator over 7 years
    This worked for me aswell - thanks!. Fedora 24 and Windows 8.1 (x64) host with a Logitech G9. VMware Workstation 12.5.
  • DaveTheScientist
    DaveTheScientist about 7 years
    Thanks a lot! Worked perfectly for me with Windows 10 host and Ubuntu 16.04 guest. After editing the .vmx I didn't even have to use xinput to map anything, the extra buttons functioned as back/forward natively.
  • EM0
    EM0 almost 7 years
    Worked perfectly for me! All I had to do is edit the .vmx file to add the 3 lines. I didn't have to disconnect the mouse from the host and the mouse still transitioned automatically between host and guest, as before. VMware Workstation 11, Windows 7 host, Ubuntu 12.04 and 16.04 guests. The VM had to be powered off and on again for this to work - suspending/resuming was not enough.
  • Pierre Henry
    Pierre Henry over 6 years
    VMware Workstation 12.5.2, Windows 7 host, Ubuntu 17.04 guest. Just stopped the VM, added these 3 lines to the VMX file and started again. Did the trick.
  • Michael Yoo
    Michael Yoo about 6 years
    This worked for me when I put it in VMNAME.vmx in it's folder. But is there a way to make this global?
  • Michael Yoo
    Michael Yoo about 6 years
    I created the file and added the changes to ~/.vmware/config with the .encoding = "UTF-8" header and it worked so I assume that's the way to set this globally (for your user). (Workstation 14)
  • lanoxx
    lanoxx over 4 years
    I can confirm that this works on a Windows 10 host with VMWare Workstation 15.5 and Ubuntu 19.10 VM as guest. I just had to add those two lines to the .vmx file.