26

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?

1
  • 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. Apr 13, 2014 at 20:26

5 Answers 5

23

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.

5
  • 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..
    – mika209
    Apr 1, 2014 at 18:00
  • 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
    – MattSayar
    Apr 1, 2014 at 21:34
  • 1
    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.
    – Halsafar
    Aug 9, 2015 at 21:46
  • 2
    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.
    – EM0
    Jul 28, 2017 at 11:34
  • 1
    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. Sep 28, 2017 at 12:25
20

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
12
  • 1
    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. Aug 17, 2014 at 16:04
  • 1
    This worked for me aswell - thanks!. Fedora 24 and Windows 8.1 (x64) host with a Logitech G9. VMware Workstation 12.5.
    – Devator
    Nov 22, 2016 at 18:54
  • 2
    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. Feb 10, 2017 at 19:58
  • 1
    This worked for me when I put it in VMNAME.vmx in it's folder. But is there a way to make this global? Mar 25, 2018 at 12:29
  • 1
    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) Mar 25, 2018 at 12:41
0
+100

You can't emulate more than 3 buttons in VirtualBox and VMware. This is because it presents to the guest system an (super) standard 3-button mouse. It could be possible if they like, but right now the answer is no.


So, why it works in Windows? Because the Linux and Windows implementations follow different roadmap, and "each front-end has its own way of getting at mouse input" (source). This can be seen in another question of Super User

5
  • 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?
    – mika209
    Apr 7, 2014 at 11:11
  • @mika209 different implementations. Is just as simple.
    – Braiam
    Apr 7, 2014 at 12:26
  • 2
    @braiam: I can not tell what is true for VirtualBox, but I can tell that VMware Workstation and Player supports 24 buttons. I will come back with an updated and expanded answer when I have time. For correctness in the meantime, it would be nice if you updated your answer to not include VMware. Apr 11, 2014 at 1:29
  • @AndersF.U.Kiær following OP comment here it apparently doesn't work.
    – Braiam
    Apr 24, 2014 at 20:53
  • @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. Apr 24, 2014 at 21:49
0

I tried all this, the fix was simple on my Dell XPS 13, Windows 10, VMware Player 12, guest Ubuntu 14.04

Launch control panel, change mouse settings, mouse & keyboard center, Microsoft mouse settings, wheel button. Set to middle mouse click instead of the default instant viewer.

This allows middle mouse click copy and paste in Ubuntu..

James

0

Tested this on Windows 10 host (should be the same on ubuntu), VMware workstation player 12, with a logitech m510 mouse.

If you do this, your mouse will only work on the virtual machine, so you'll need to know the keyboard shortcuts to enable and disable, unless you have two mouses, or a touchpad and a mouse, like in a notebook.

  1. Go to your virtual machine folder and locate the .vmx file.
  2. Edit it in notepad and add:

    usb.generic.allowHID = "TRUE"
    usb.generic.allowHID = "TRUE"
    usb.generic.allowLastHID = "TRUE"
    
  3. Open the virtual machine and navigate to Virtual Machine > Removable Devices > [Your Mouse] > Connect (Disconnect from Host). When you do it, the mouse will only work on the virtual machine.

  4. Install logitech mouse driver/software on the virtual machine (you can do this step before everything if you want)
  5. You may press Ctrl+G on your keyboard to get rid of the host mouse icon and fully immerse yourself in the VM.
  6. When you want to use the mouse on the host machine again, hit Ctrl+Alt, then release, so that the focus be on the vmware player, not the virtual machine. Now you can use the regular windows keyboard shortcuts. In this case press Alt+P to open the vmware workstation player menu, and use the keyboard arrow keys to navigate to Virtual Machine > Removable Devices > [Your Mouse] > Disconnect (Connect to Host).

You must log in to answer this question.

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