Problems With Mouse Scroll Wheel When Using Guest Additions

Discussions about using Linux guests in VirtualBox.
Watter
Posts: 6
Joined: 27. Aug 2017, 16:47

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by Watter »

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.
Dreyk
Posts: 1
Joined: 16. Mar 2018, 11:35

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by Dreyk »

already 2018 and still not fixed... Previous workaround dosent work with Ubuntu 16.04 as guest. Any news to avoid this bug?
WombatFromHell
Posts: 3
Joined: 5. Sep 2017, 22:25

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by WombatFromHell »

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

sudo apt install imwheel
Then creating an .imwheelrc file in your $HOME, with this in it:

Code: Select all

"^.*$"
    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

imwheel -b "4 5" &
.. or alternatively (if you get config file related errors) the following may work instead ..

Code: Select all

imwheel -b 45 &
All this restores mousewheel functionality in Xorg back to something closer to normal. Hope this helps!
myNameIsJeff
Posts: 1
Joined: 9. Sep 2018, 22:15

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by myNameIsJeff »

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.
CTS_Æ
Posts: 1
Joined: 27. Jan 2019, 13:08

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by CTS_Æ »

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"
LRI_David
Posts: 1
Joined: 3. May 2019, 09:31

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by LRI_David »

Hi Everyone,

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

Code: Select all

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.
baloonick
Posts: 1
Joined: 22. Jul 2019, 21:26

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by baloonick »

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 16076 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 16076 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.
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by socratis »

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... ;)

Image


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.
audiobrian
Posts: 1
Joined: 25. Jul 2019, 18:00

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by audiobrian »

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

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection
Just change

Code: Select all

Driver "libinput"
to

Code: Select all

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

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 !
GZapp
Posts: 1
Joined: 30. Oct 2019, 21:20

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by GZapp »

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.
User Name
Posts: 2
Joined: 26. Sep 2019, 21:38

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by User Name »

[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

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

Section "InputClass"
        Identifier "Fix VBox scroll wheel"
        MatchProduct "VirtualBox mouse integration"
        Option "Ignore" "on"
EndSection
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.
facboy
Posts: 28
Joined: 19. Jan 2016, 09:35

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by facboy »

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.
Dr. Mad
Posts: 1
Joined: 6. May 2020, 10:02

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by Dr. Mad »

WombatFromHell wrote: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

sudo apt install imwheel
Then creating an .imwheelrc file in your $HOME, with this in it:

Code: Select all

"^.*$"
    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

imwheel -b "4 5" &
.. or alternatively (if you get config file related errors) the following may work instead ..

Code: Select all

imwheel -b 45 &
All this restores mousewheel functionality in Xorg back to something closer to normal. Hope this helps!
Many thanks, WombatFromHell, your fix is the one that finally worked! I use ", 1" instead of ", 2", since a single scroll wheel aka button action already skips 3 lines, and imwheel can be configured to start as part of your xsession, cf. /etc/X11/imwheel/startup.conf, but I primarily wanted to confirm that your workaround still solves the issue -- and that this issue still exists in Virtualbox as of 2020, sic.

Guest: Debian Testing with virtualbox-guest-utilts 6.1.6
Host: Windows 10 Enterprise 1809 with Virtualbox 6.1.2
Sarke
Posts: 13
Joined: 4. Jan 2019, 06:03

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by Sarke »

I can also confirm that WombatFromHell's

Code: Select all

imwheel -b "4 5" &
solution worked. :D
Itchy
Posts: 2
Joined: 7. Jul 2021, 16:27

Re: Problems With Mouse Scroll Wheel When Using Guest Additions

Post by Itchy »

Dr. Mad wrote:
WombatFromHell wrote: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

imwheel -b "4 5" &
All this restores mousewheel functionality in Xorg back to something closer to normal. Hope this helps!
Many thanks, WombatFromHell, your fix is the one that finally worked! I use ", 1" instead of ", 2", since a single scroll wheel aka button action already skips 3 lines, and imwheel can be configured to start as part of your xsession, cf. /etc/X11/imwheel/startup.conf, but I primarily wanted to confirm that your workaround still solves the issue -- and that this issue still exists in Virtualbox as of 2020, sic.
I can confirm the issue still persists in the latest release of Virtualbox and Kali.

The workaround does its job for scrolling down, scrolling up however is still not working while moving the mouse.
For some reason I never have this problem in Firefox but in all other applications.
Post Reply