Unable to move mouse and scroll at the same time on Linux

Discussions related to using VirtualBox on Windows hosts.
Post Reply
lylemelende
Posts: 7
Joined: 12. Sep 2021, 12:07

Unable to move mouse and scroll at the same time on Linux

Post by lylemelende »

This only occurs when I am using Virtualbox's Integrated mouse mode in Linux virtual machines. When I am moving my mouse, scrolling does not work at all. My mouse must remain completely motionless until scrolling starts to work again.

There is a stackexchange post that investigates this issue in more detail, explaining that this is caused by having two different pointer input devices on the Linux machine, one from the Integrated mouse and another from Virtualbox's default mouse input. I can't post the link due to forum rules so here is the title of the stackexchange post: "Scrolling impossible while moving mouse - Fedora 28 VM guest on Win10".

I have tested this with xubuntu 20.10 and a fresh install of Linux Mint 20.2, both machines have the same issue.

My computer specs:

Virtualbox 6.1.26
Windows 10 64 bit
Intel i5-9400F
32GB Ram
GTX 750 Ti
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Unable to move mouse and scroll at the same time on Linux

Post by mpack »

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.
lylemelende
Posts: 7
Joined: 12. Sep 2021, 12:07

Re: Unable to move mouse and scroll at the same time on Linux

Post by lylemelende »

Here is the log file:
Attachments
Mint-2021-09-12-13-30-24.zip
(35.82 KiB) Downloaded 12 times
lylemelende
Posts: 7
Joined: 12. Sep 2021, 12:07

Re: Unable to move mouse and scroll at the same time on Linux

Post by lylemelende »

I did a bit of investigating, this is caused by having mouse move and scroll events being sent by different cursor input devices.

Using the following command:

Code: Select all

xinput test-xi2 --root
I can see the following:

Code: Select all

EVENT type 17 (RawMotion)
    device: 2 (9)
    detail: 0
    flags: 
    valuators:
          0: 1704.97 (1704.97)
          1: 39323.40 (39323.40)

EVENT type 6 (Motion)
    device: 9 (9)
    detail: 0
    flags: 
    root: 55.23/570.23
    event: 55.23/570.23
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 1704.97
        1: 39323.40
    windows: root 0x532 event 0x532 child 0x4600003
EVENT type 17 (RawMotion)
    device: 2 (12)
    detail: 0
    flags: 
    valuators:
          3: 15.00 (15.00)

EVENT type 6 (Motion)
    device: 12 (12)
    detail: 0
    flags: 
    root: 55.23/571.23
    event: 55.23/571.23
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        3: -1470.00
    windows: root 0x532 event 0x532 child 0x4600003
EVENT type 15 (RawButtonPress)
    device: 2 (12)
    detail: 5
    flags: emulated
    valuators:

EVENT type 4 (ButtonPress)
    device: 12 (12)
    detail: 5
    flags: emulated
    root: 55.23/571.23
    event: 55.23/571.23
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x532 event 0x532 child 0x4600003
EVENT type 16 (RawButtonRelease)
    device: 2 (12)
    detail: 5
    flags: emulated
    valuators:

EVENT type 5 (ButtonRelease)
    device: 12 (12)
    detail: 5
    flags: emulated
    root: 55.23/571.23
    event: 55.23/571.23
    buttons: 5
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
    windows: root 0x532 event 0x532 child 0x4600003
Motion events are sent by device 9 (VirtualBox mouse integration), while scroll events are sent by device 12 (ImExPS/2 Generic Explorer Mouse).

Code: Select all

$ xinput
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ VirtualBox mouse integration            	id=9	[slave  pointer  (2)]
⎜   ↳ VirtualBox USB Tablet                   	id=10	[slave  pointer  (2)]
⎜   ↳ ImExPS/2 Generic Explorer Mouse         	id=12	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=11	[slave  keyboard (3)]
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Unable to move mouse and scroll at the same time on Linux

Post by scottgus1 »

So the link for "Scrolling impossible while moving mouse - Fedora 28 VM guest on Win10" is https://unix.stackexchange.com/question ... t-on-win10, and the answer there links to viewtopic.php?f=3&t=79002&start=15, where the apparent "double mouse devices" appears to my Linux-noob eyes as being a Linux driver interpretation of Virtualbox's MI mouse, rather than Virtualbox actually providing two devices. The log shows what Virtualbox provides:

One instance of this at boot:
00:00:03.681271 VUSB: Attached 'HidMouse' to port 1 on RootHub#0 (FullSpeed)

One instance of this at shutdown:
00:02:04.734997 VUSB: Detached 'HidMouse' from port 1 on RootHub#0

So only one device is being inserted, which Linux is breaking into two devices. The Virtualbox post above contains suggested Linux manipulation way above my knowledge level, but it appears that there are some tweaks that can be made to Linux, or maybe changing the Virtualbox-provided device from PS/2 mouse to USB Tablet or vice versa.

Since the log records only one mouse inserted and one mouse removed, I cannot see so far that Virtualbox is making a mistake or has a bug.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Unable to move mouse and scroll at the same time on Linux

Post by scottgus1 »

If this by chance does come back to the Guest Additions mouse drivers being the problem, a post with logs and a link back to this topic on the Bugtracker would help the devs investigate.
arQon
Posts: 231
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Unable to move mouse and scroll at the same time on Linux

Post by arQon »

Isn't this just the generic "GTK3 is broken AF" problem?

try "GDK_CORE_DEVICE_EVENTS=1" in /etc/environment
Post Reply