Problems With Mouse Scroll Wheel When Using Guest Additions

Discussions about using Linux guests in VirtualBox.

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby Watter » 11. Sep 2017, 14:26

WombatFromHell wrote:Basically, the problem is related to a bug in libinput, and switching the pointer driver to evdev is seemingly the only solution.

Interesting. I guess this is why Mint 18.2 worked for me where Arch did not. It's using evdev instead of libinput by default. As I mentioned above, the caveat is that while the mousewheel now works as expected in my browsers, it has the "no scroll while pointer is moving" behavior in system applications like Kate, Dolphin, or Konsole. It's a trade off, but one I can live with.
Posts: 6
Joined: 27. Aug 2017, 16:47

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby Dreyk » 16. Mar 2018, 11:36

already 2018 and still not fixed... Previous workaround dosent work with Ubuntu 16.04 as guest. Any news to avoid this bug?
Posts: 1
Joined: 16. Mar 2018, 11:35

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby WombatFromHell » 18. Mar 2018, 06:54

I can, in fact, confirm that doing something like the following works for Ubuntu dating as far back as 12.04, but it may require enabling the 'universe' repo in your sources.list:

Code: Select all   Expand viewCollapse view
sudo apt install imwheel

Then creating an .imwheelrc file in your $HOME, with this in it:

Code: Select all   Expand viewCollapse view
    None, Up, Button4, 2
    None, Down, Button5, 2
    Shift_L,   Up,   Shift_L|Button4, 2
    Shift_L,   Down, Shift_L|Button5, 2
    Control_L, Up,   Control_L|Button4
    Control_L, Down, Control_L|Button5

Then running imwheel (most likely by editing your session or using whatever session editor you prefer) with something like:

Code: Select all   Expand viewCollapse view
imwheel -b "4 5" &

.. or alternatively (if you get config file related errors) the following may work instead ..
Code: Select all   Expand viewCollapse view
imwheel -b 45 &

All this restores mousewheel functionality in Xorg back to something closer to normal. Hope this helps!
Posts: 3
Joined: 5. Sep 2017, 22:25

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby myNameIsJeff » 9. Sep 2018, 22:27

So I know this is old, but I still had the same problem and although I haven't tried any of the previously mentioned solutions, I found a "good" workaround for this issue.

so here it is: in virtualbox manager, click settings for the OS in question, and go to System and make Pointing Device: PS/2 Mouse.

Not a super fancy or difficult solution, but it works. However, this created the issue for me of loosing my mouse whenever I needed it outside of the virtual environment. But you can get it back by simply switching between different views, like full-screen.
Posts: 1
Joined: 9. Sep 2018, 22:15

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby CTS_Æ » 27. Jan 2019, 13:09

Crazy this hasn't been handled :0
Maybe someone can patch the core linux mouse driver bug! :P
Did anyone put in an issue for it?

I wanted to say I found this blog to be super helpful for setting up imwheel
I did remove the 3 at the end of the config lines because I was getting 9 line jumps (3 x 3 ?) - maybe due to the VM? After removing those though it worked nicely.

Edit I guess I cannot post a link until after I have 1 message and 24 hours on my accounts : [

In case I forget to make it back here and update this...
webupd8 org "how to change mouse scroll wheel speed"
Posts: 1
Joined: 27. Jan 2019, 13:08

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby LRI_David » 3. May 2019, 09:39

Hi Everyone,

Just in case someone is still encountering this problem. What solved my problem was to install evdev (for Ubuntu):

Code: Select all   Expand viewCollapse view
sudo apt-get install xserver-xorg-input-evdev-hwe-18.04

After the evdev was downloaded and installed, it automatically selected evdev, and the mouse wheel worked correctly.
Posts: 1
Joined: 3. May 2019, 09:31

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby baloonick » 22. Jul 2019, 22:06

I found the native solution which I found during work on Linux Mint 19.1 Xfce. Unfortunately, I don't know how to change, described below setting, on Ubuntu. Maybe someone else will be able to help with it.

I was intrigued by the comment:
Watter wrote:What's interesting, and perhaps irrelevant, is that the mouse functionality is apparently split between the two USB devices. One registers motion events and the other button (and the wheel is a button) events. I thought that perhaps this dual device with different event capturing might be relevant, but perhaps not. According to "xinput --test" on the device that registers button presses, the mousewheel events ARE coming through to the system while the mouse is moving. So where are they getting dropped?

After digging through multiple websites and testing I found out that:
  • there are actually 2 devices which handle part of the mouse events separately as Watter mention in his post. In my case it was:
    "ImExPS/2 Generic Explorer Mouse" and "VirtualBox mouse integration", one of those devices detects movement, the second one register pressed buttons. And those 2 couldn't work simultaneously.
  • In Xfce shell settings I found options (Settings -> Mouse and Touchpad) which allow on choosing pointer device. Unfortunately, with Mate, Cinamon or Ubuntu 18.04 it looks differently. So I don't how to find it.
    • Virtual-Box-Mint-22-07-2019-21-50-30.png
      Virtual-Box-Mint-22-07-2019-21-50-30.png (45.84 KiB) Viewed 956 times
    • Virtual-Box-Mint-22-07-2019-21-51-27.jpg
      Virtual-Box-Mint-22-07-2019-21-51-27.jpg (79.26 KiB) Viewed 956 times
  • After the switch pointing device from "VirtualBox Mouse Integration" (disable it as well) to "VirtualBox USB Tablet" and system restart, this became my default pointing device (You can also completely disable "ImExPS/2 Generic Explorer Mouse"). Everything starts to work fine and I could scroll and move the mouse altogether. What is also interesting, that order of pointing devices changes in xinput (what can be seen on the second screenshot). Now with xinput test reacts only for VirtualBox USB Tablet which has both movement and mouse buttons.
  • If you don't see VirtualBox USB Tablet in your guest system then check settings of the VM. There should be settings for pointing device in System -> motherboard section just below chipset.

I'm suspect that similar changes might be somehow done through the console, also on other OS like Ubuntu. If you read it and you know how to change it in some other OS, please left a comment. :)
I hope this gave some better starting point for other readers.
Last edited by baloonick on 23. Jul 2019, 08:29, edited 1 time in total.
Posts: 1
Joined: 22. Jul 2019, 21:26

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby socratis » 23. Jul 2019, 00:22

baloonick wrote:I'm not allowed to post pictures so I left them in such form:

Yes, you are allowed, and it's in fact preferred if you attach the images locally in your response (see the "Upload attachment" tab below the reply form). Not a lot of people will go to 3rd party sites. Plus, it's more convenient if the image goes along with the message... ;)


PS. If it's a Terminal output (like your 2nd image), it would be even better if you copied/pasted the actual text in a <pre> tag...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Site Moderator
Posts: 27693
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby audiobrian » 25. Jul 2019, 18:00

WombatFromHell wrote:I registered an account on this forum just so I could share a solution that seems to work for both Virtualbox and VMware. Basically, the problem is related to a bug in libinput, and switching the pointer driver to evdev is seemingly the only solution.

To workaround this you'll need to install the evdev driver (it's named different things in different distro's, google the package name and double check that it's installed before continuing) and change the file /usr/share/X11/xorg.conf.d/40-libinput.conf (it may be named slightly different depending on your distro). There's a section that looks something like the following:
Code: Select all   Expand viewCollapse view
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"

Just change
Code: Select all   Expand viewCollapse view
Driver "libinput"
Code: Select all   Expand viewCollapse view
Driver "evdev"

Save the file, and restart your DM (or reboot the guest). Your mousewheel should now work, and if you do an xinput list-props on the vmmouse devices you should see them report with evdev device options.

I hope this helps anyone else that might have issues with this bug.

(Edit: If you're running VMware (this shouldn't be necessary with VirtualBox) as your host you may also need to add the following to your guest's vmx config:)
Code: Select all   Expand viewCollapse view
mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
usb.generic.allowHID = "TRUE"

(Edit2: If you still have issues, you may want to double check that you're not running in a Wayland instance (Xorg generally works better for guests anyway). In addition, you may want to combine the evdev workaround with using imwheel to control the speed of scrolling in whatever arbitrary windows you prefer. Besides imwheel there's no other known way to control mouse scrolling speed inside a guest that I've found.)

It worked for me!!! Thanks !
Posts: 1
Joined: 25. Jul 2019, 18:00

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby GZapp » 30. Oct 2019, 21:27

Just wanted to say that baloonick's suggestion worked for me on XUbuntu 19.10.

I was confused and distracted initially as to why VirtualBox was defaulting the input device to tablet on my new VM. Turns out you want this and it is apparently a bit of tribal knowledge baked into the defaults.

After disabling the virtual box mouse pointer in the mouse settings scrolling started to work as expected.

I'm not sure if it's as good as the old mouse pointer + evdev setup.. Hard to believe this issue has been around since the libinput switch and the information required to fix it so obscure.
Posts: 1
Joined: 30. Oct 2019, 21:20

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby User Name » 5. Dec 2019, 01:23

[Apologies for using a BugMeNot account, but I don't intend to return and I sure as hell don't want to give Oracle my email address.]

I was able to fix the problem in Lubuntu 19.10 on the command line with xinput. Find the ID number of the VirtualBox mouse integration (it's 9 in baloonik's screenshot), then do:
Code: Select all   Expand viewCollapse view
xinput disable <id>

Sadly, this does not persist across reboots. To fix that, I used a solution from Stack Exchange. I created a file called 40-vbox-fix.conf in the /etc/X11/xorg.conf.d directory that contains the following text:
Code: Select all   Expand viewCollapse view
Section "InputClass"
        Identifier "Fix VBox scroll wheel"
        MatchProduct "VirtualBox mouse integration"
        Option "Ignore" "on"

This will completely remove the device from the xinput list. Make sure the MatchProduct parameter matches the exact name of the mouse integration device from the xinput list.
User Name
Posts: 3
Joined: 26. Sep 2019, 21:38

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Postby facboy » 26. Mar 2020, 15:48

Unfortunately balloonick's approach of disabling the two mice doesn't work for me on CentOS 8 Xfce, it just results in a non-functioning mouse. It doesn't respond to clicks.
Posts: 14
Joined: 19. Jan 2016, 09:35


Return to Linux Guests

Who is online

Users browsing this forum: No registered users and 19 guests