Problem with mouse wheel

Discussions about using Linux guests in VirtualBox.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Problem with mouse wheel

Post by hsweeten »

Hello,
I have been having issues with my mouse wheel in Linux guests (Windows 11 Host). Using VirtualBox Version 7.0.6 r155176 (Qt5.15.2). I do not see this issue in Windows guests.

Sometimes when I roll the wheel I get odd switches to a different "workspace" in Linux. Or, if I am editing a document and scroll the wheel, I get odd jumps to different locations in the document. It does not "scroll" correctly.

I'm not sure when this started happening but it's got to the point where it is really annoying.

Any ideas on how to fix this?

Thanks
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problem with mouse wheel

Post by scottgus1 »

I've heard there is a utility that Linux has which can tell what signals are being transmitted from the mouse. I don't know what it is called. If this utility can report what signals are coming in when the problem is happening vs when it is not, maybe it can be tracked down.

Could the behavior be explained by what happens if a modifier key on the keyboard is held down while scrolling, like Shift-scroll-down means page down instead of line down or something like that?
fth0
Volunteer
Posts: 5689
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem with mouse wheel

Post by fth0 »

scottgus1 wrote: 19. Jul 2023, 19:41 I've heard there is a utility that Linux has which can tell what signals are being transmitted from the mouse.
You're probably talking about xev, which can display keyboard and mouse events. A useful companion is xwininfo -tree, which can deliver window ids.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Problem with mouse wheel

Post by mpack »

This could simply be a side effect of a congested VM.

Please provide a VM log file. Make sure the VM is fully shut down, then right click it in the manager UI. Select "Show Log" and save "VBox.log" (no other file) to a zip file. Attach the zip here.

I seem to recall there are also websites you can visit to exercise mouse and keyboard events. Those should work for any OS with a modern Internet browser.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

Not sure if this helps figure out a solution, but...

If I disable the "VirtualBox mouse integration", the scroll wheel works fine:

Code: Select all

$ xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ ImExPS/2 Generic Explorer Mouse         	id=6	[slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation        	id=11	[slave  pointer  (2)]
⎜   ↳ VirtualBox mouse integration            	id=12	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ Power Button                            	id=10	[slave  keyboard (3)]
$ xinput disable 12
But then I can't just move the mouse out of the VM to my host. I also can't remember what key combination releases the mouse from the VM. So I have to reenable the "VirtualBox mouse integration" to get back to my host:

Code: Select all

$ xinput enable 12
Can anything be done to "fix" the "VirtualBox mouse integration"? I think this issue started when I updated to VistualBox 7. I have been using this VM for a couple years with no mouse issues until now.

Thanks
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problem with mouse wheel

Post by scottgus1 »

Please remember to read and reply to what's been posted to your topic before asking further questions. You had three posts that you seem to have ignored.

Please try fth0's and Mpack's suggestions. Post what is shown while Mouse Integration is on and while it is off. Also the log Mpack asked for.
hsweeten wrote: 20. Jul 2023, 19:20 I also can't remember what key combination releases the mouse from the VM.
A tap of the Host key, see the Status bar lower right corner.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

To scottgus1:

I read all the replies and did not ignore them.

Your reply mentioned a utility but not what it is. I don't know either.

Also, I am not holding down any modified keys on the keyboard. Just scrolling the mouse wheel.

To fth0:

I tried the xev utility. It outputs stuff but nothing when I scroll the mouse wheel. It looks like it just reports window events.

The xwininfo -tree output was also not helpful.

To mpack:

I have not had a chance to shutdown the VM yet to generate the log file. This VM is used for supporting a legacy PowerPC system I have. It is an old CentOS 6.6 system, I only shut it down when necessary.
fth0
Volunteer
Posts: 5689
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem with mouse wheel

Post by fth0 »

hsweeten wrote: 21. Jul 2023, 02:21 I tried the xev utility. It outputs stuff but nothing when I scroll the mouse wheel. It looks like it just reports window events.

The xwininfo -tree output was also not helpful.
Ah, it sounds like you might need a little bit of explanation: The basic idea was to use xwininfo -tree to determine the window id of an X11 window of your choice, and then use xev to monitor the mouse events reaching this window.

Regarding your original problem, it might help to make a different selection in System > Motherboard > Pointing Device. Some users had a better experience with PS/2 Mouse than with the default USB Tablet.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

fth0,

Thanks for the explanation.

I used xwininfo -tree to get the id of a window I have trouble with. xev -id windowid then does show events as I move the mouse around. They mostly look something like this:

Code: Select all

MotionNotify event, serial 13, synthetic NO, window 0x4200037,
    root 0xef, subw 0x0, time 83089723, (2808,1320), root:(2894,1386),
    state 0x0, is_hint 0, same_screen YES
But when I scroll the wheel I don't see any events.

Also, my Pointing Device is already PS/2 Mouse.

This issue did not start until I updated to Virtual Box 7. I think the original VM was created with version 4 (or earlier). But I know I use versions 5 and 6 with no issues.

I have noticed that as long as I don't move the mouse while scrolling the wheel it will work. But if I just bump the mouse a bit while scrolling I get weird actions (like a keyboard modifier is held down).

I have attached the VBox.log as requested earlier.

Thanks
Attachments
VBox.zip
(41.12 KiB) Downloaded 19 times
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

I just checked and saw there was an update for Virtual Box. So I installed Version 7.0.10 r158379 (Qt5.15.2) and the new Guest Additions.

That sees to have helped the mouse wheel issue. Now it does not switch randomly to a different "workspace" when I scroll the wheel when the mouse is moving.

But, sometimes it still does not scroll properly. If I try to scroll a document I and editing and move the mouse, it will sometimes just jump back to the position the cursor is in the job.

Also, the latest update seems to have jacked up my display. I can no longer resize the display by dragging the corner of the window. It now just stays at the resolution set by the Display Preferences. The highest resolution I can set it is 2560 x 1920. My monitors are all 3840 x 2160 and I used to be able to resize the window to fill the display.

Ugh...
fth0
Volunteer
Posts: 5689
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem with mouse wheel

Post by fth0 »

Regarding the mouse wheel issues, I can only tell that the transporting mechanisms for mouse events have been changed several times during the previous VirtualBox release updates (I hope for the better ;)).

Regarding the display issue, you could reproduce the issue with VirtualBox 7.0.10 and create a new forum thread with a description and a (zipped) VBox.log file.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

Well, I was wrong. The latest version of Virtual Box still has the issue with the mouse wheel.

As long as I don't move the mouse, the wheel works fine. If I move the mouse while turning the wheel I get all kings of goofy results.

Turning off the Mouse Integration seems to fix it but I have not ran it in that mode very much.

BTW, I don't see this problem in a Windows guest. Just in a Linux guest.
fth0
Volunteer
Posts: 5689
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem with mouse wheel

Post by fth0 »

hsweeten wrote: 26. Jul 2023, 02:38 If I move the mouse while turning the wheel I get all kings of goofy results.
I've read such reports from time to time, but without any solution except simply not to do it. ;)

If you're talking about very small and unwanted movements, you could try and play with the sensitivity of the mouse.
hsweeten wrote: 26. Jul 2023, 02:38 BTW, I don't see this problem in a Windows guest. Just in a Linux guest.
Yes, the methods to provide the mouse information are quite different for different guest OSes.
hsweeten
Posts: 30
Joined: 21. Apr 2020, 17:27

Re: Problem with mouse wheel

Post by hsweeten »

So basically Version 7 is broken....

I did not have these problems with earlier version.
fth0
Volunteer
Posts: 5689
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Problem with mouse wheel

Post by fth0 »

hsweeten wrote: 26. Jul 2023, 17:20 So basically Version 7 is broken....
Not for the majority of users.
hsweeten wrote: 26. Jul 2023, 17:20 I did not have these problems with earlier version.
Others did. I've been reading about it (lost scroll wheel events while moving the mouse) perhaps once or twice a year for several years now. This makes it a long time issue for a small amount of users.
Post Reply