Getting mouse wheel to work with KVM and Ubuntu

Posted by Michael on November 3, 2008 in Servers, Systems

I have been busy getting a Ubuntu based Network Attached Storage server up and running as well as finally switching my trusty desktop to Ubuntu running my old Windows XP as a VMWare Server image.  All was fine and dandy until I decided to add a KVM to the mix so I could easily switch between the NAS and my workstation without having to have two monitors and keyboards.

Turns out the mouse wheel would stop working after a switcharoo.  It took me a little while to track down the solution on the Ubuntu forums.  There was a lot of back and forth in the comments, but this is the dead-simple solution:

Ensure the psmouse module is loading

Edit and add the following line to /etc/modules:

psmouse

You’ll need to use sudo (i.e. sudo vi /etc/modules).

Set the imps option for the module

As sudo user, edit /etc/modprobe.d/options and append the following:

 # Make my mouse work with KVM
 options psmouse proto=imps

Reload the mouse module

Once you have the above, issue the following commands:

 # sudo modprobe -r psmouse
 # sudo modprobe -a psmouse

Once you do this, you should have a functioning mouse wheel. Test it out before and after switching machines with your KVM hot keys.

Thanks to the contributors of the Ubuntu Forums for this.

  • woody
    Worked great! Note that the /etc/mprobe.d/options is no longer there. You need to put the instructions in a file with .conf extension in the modprobe.d directory instead
  • Giovanni
    Thanks a lot, it worked perfectly! I'm not fearing the kvm switch anymore :-)
  • Andrew C
    Works for me too, in 8.04. I had no idea it was the KVM switch killing it - luckily, a google for "ubuntu dead mouse" led me here. Thanks!
  • gallaleo
    Awesome tip. This has bothered me for a long time.
blog comments powered by Disqus

More

Read more posts by Michael

About the Author

A software developer and network engineer for over 25 years. Currently developing Microsoft Windows desktop applications with Delphi and web services with Ruby, Ruby on Rails, Ramaze and Javascript. Web services are hosted on CentOS and Ubuntu servers under either Xen or VMWare powered via Apache, passenger, mysql and postgresql.