KVM virtualization with VMM/virt-manager and mouse lag and stutter
This is one of those I-fixed-it-myself posts where I'm just sharing my
solution for others, should they google it in the future.
I recently started learning about KVM virtualization. Naturally I
stumbled across the VMM/virt-manager GTK tool, since that's pretty much
the only good tool available at the moment (aqemu is promising but not
good), so I started loading up some Linux live ISO images.
Immediately I had the problem where my mouse was lagging all over the
place and the experience was horrible!
When I started my VMs manually from the command line with qemu, I
noticed the mouse lag problem completely went away. Also, later, I
noticed that the Fedora live ISO images did not have this problem.
VMM forces you to use Spice, even if you are running on the hypervisor
itself. You have to use either VNC or Spice. You can't start a native
qemu window like you can do by starting a qemu command manually.
The reason the Fedora Live images worked was because they have the
spice-vdagent package already installed. The spice-vdagent creates a
communications channel between the client/viewer host and the
guest/client host so that mouse movement is smooth, copy-paste/clipboard
functionality works, and a few other things.
Unfortunately, other than Fedora, none of the other Linux live images I
tested have this package installed by default: Not Ubuntu, not Mint, not
Debian, not KDE Neon. OpenSUSE installs it by default, but it's not
really a live CD. These distros should all fix this if they want people
to have a good experience when testing under KVM.
And, because these are Live CD images, it's not like I can easily
install the package and logout/restart, since I have not configured a
hard drive/permanent storage.
Fortunately, I found a hacky solution in VMM: Add Hardware --> Input
--> EvTouch USB Graphics Tablet
Adding a tablet device fixes many of the problems which I experienced
with VMM, without installing the spice-vdagent on the guest OS.
After finding this solution myself, I also googled and found this post,
which gives a similar solution to a slightly different problem:
So if you use virt-manager and your mouse movement is horribly laggy,
stuttery, and otherwise intolerable, install spice-vdagent or configure
VMM to add a non-existent tablet device to the guest.