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?

Jacob Vlijm
  • 85,475
mika209
  • 263

5 Answers5

24

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.

MattSayar
  • 266
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
Anders F. U. Kiær
  • 2,171
  • 1
  • 18
  • 29
0

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

Braiam
  • 69,112
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

Jims
  • 1
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).
Lombas
  • 101