Search code examples
virtualboxmousearchlinuxi3

VirtualBox (ArchLinux guest) - Mouse issues


I'm using ArchLinux (guest) inside a VirtualBox machine (windows 10 host).

The mouse always worked until now.

The symptoms:

  • On Chromium, the click (left/right) on the extensions, on the address bar, on the tabs, on the bookmarks doesn't work (it does nothing, it's like I'm not clicking). Sometimes, clicks altogether doesn't work at all anywhere (not even on the page or anything).

  • On xterm, when I Ctrl+Click to open the config menu, it works. But when I hover and/or click into the menu, it does nothing (the highlight when hovering doesn't show either).

  • Globally, sometimes the mouse does not work at all, I can only move it (not click)

I'm using i3 (with Xorg)

$ i3 --version
i3 version 4.15 (2018-03-10)

$ VBoxClient --version
5.2.12r122571

$ pacman -Q | grep virtualbox
virtualbox-guest-modules-arch 5.2.12-10
virtualbox-guest-utils 5.2.12-2

I did a system upgrade recently, that might installed something that cause the issue.

Please tell me what you need (logs, version, ...), I really need to fix this really weird problem!

EDIT: It works fine if I disable the Mouse Integration but the cursor is a bit laggy. So it seems that the problem is coming from VirtualBox.

UPDATE: I've try to install a fresh Manjaro VM and the mouse does not work properly either. And also, sometimes the mouse works perfectly fine.

UPDATE: I've tested with evtest, xinput and xev. So, I basically have 3 main devices detected:

  • VirtualBox USB Tablet
  • VirtualBox mouse integration
  • ImExPS/2 Generic Explorer Mouse

Here is what each devices registers with which tool:

-- evtest
Device                          | Registers clicks | Registers position |
=========================================================================
VirtualBox USB Tablet           |               no |                 no |
VirtualBox Mouse Integration    |               no |                yes |
ImExPS/2 Generic Explorer Mouse |              yes |                 no |

-- xinput test
Device                          | Registers clicks | Registers position |
=========================================================================
VirtualBox USB Tablet           |               no |                 no |
VirtualBox Mouse Integration    |               no |                yes |
ImExPS/2 Generic Explorer Mouse |        sometimes |                 no |

-- xev
Registers only mouse movement consistently, clicks are sometimes registers

When I say "sometimes", it means like in a boot session; what happens is that every time I start my VM everything "works" (the clicks and movement are registered by each test program listed above, but the symptoms are still present). If the VM stays up for too long, the clicks are not registered anymore by the programs, and don't work anymore anywhere.

Hope everything is understandable.

Thanks.


Solution

  • I also had this issue. Looks like a more general (not Arch Linux specific) issue with VirtualBox and 4.17 Linux kernels and has a bug ticket here: https://www.virtualbox.org/ticket/17827

    My personal workaround until a solution is available is to force that the vboxguest kernel module is not loaded by adding a file modprobe.conf to /etc/modprobe.d with content

    install vboxguest /bin/false
    

    (I assume you can alternatively blacklist both vboxguest and vboxsf or uninstall virtualbox-guest-utils)

    Unfortunatly, this loses all Virtual Box Guest Addition functionality, such as clipboard sharing.

    Edit: Another workaround mentioned in the ticket also works for me: after boot, start i3 once and then exit it again immediately ($mod+shift+E or, if the confirmation is not usable without mouse: pkill i3). Start i3 again (startx) and the mouse seems to work fine.