12

Is there a way to move my mouse in and out of a KVM guest in virt-manager without having to click to gain focus of the window and release focus by pressing Ctrl_L+ Alt_L?

BACKGROUND

I typically connect from a Fedora 14 system using virt-manager to manage guest KVMs running on a CentOS 5 system. To see if it mattered I tried using these other versions of virt-manager & libvirt to see if it was a version issue:

OS            virt-manager       libvirt       Steals focus?
--            ------------       -------       -------------
Fedora 14     0.8.7-2            0.8.3-10      Yes
CentOS 5      0.6.1-16           0.8.2-25      Yes
CentOS 6      0.9.0-14           0.9.10-21     Yes

Not sure if it matters but the guest VM is Win2008R2, but I've seen this same issue with other OSes as guests.

Here's a screenshot of the guest VM before and after I click into it showing that it's stealing the focus.

               ss of guest VM before click

               ss of guest VM after click

EDIT #1

I just tried the solution recommended by @tpow and that appears to be the issue. Manually adding a tablet input device resolves the problem and I can now move the mouse in and out of the KVM guest without having to gain focus first.

Here's a screenshot of the guest VM with focus.

               ss of guest vm with focus & tablet input

slm
  • 7,355
  • 16
  • 54
  • 72

2 Answers2

13

You can use a virtual tablet instead of the virtual mouse, and then you won't have to press Ctrl_L & Alt_L. The virtual tablet also improves the mouse tracking by using absolute coordinates instead of relative motion deltas.

To use the virtual tablet, first shutdown your vm. Using virt-manager, select the virtual machine, then select View -> Details, click the Add Hardware button, select Input, and choose "EvTouch USB Graphics Tablet", then click Finish. Start up your vm and you should be all set.

Here's a screen shot of the steps from the Details View:

virtual tablet - howto

tpow
  • 246
  • 2
  • 4
  • For occasional access in a Windows VM this is sufficient and quick. For an overall improved experience in desktop integration, see my answer. – gertvdijk Dec 12 '12 at 22:48
  • By the way, adding a tablet device makes my machines a lot more CPU hungry for some reason. See [this graph](https://twitter.com/gertvdijk/status/245250032993964032/photo/1) showing the effect of removing them all on my CPU temperature. – gertvdijk Dec 13 '12 at 13:06
5

Yes. Use SPICE and the vdagent to have the best experience. SPICE is far more efficient than VNC and the vdagent will provide nice pointer and clipboard integration.

I'm not familiar with the exact steps, but it comes down to this:

  • Install the QXL video driver and virtio serial driver in the guest.
  • Install the vdagent and start the Windows service.
  • Activate the SPICE channels and select the QXL virtual graphics card in virt-manager.

Result: same as VirtualBox and VMware - fair video performance (have seen 720p full screen running smooth), very good pointer/clipboard integration.

gertvdijk
  • 3,362
  • 4
  • 30
  • 46
  • I tried this approach and I do see a improvement in performance using SPICE vs. VNC however the guest OS we're currently using, Win2008R2 doesn't appear to be supported as of yet (2012-12-13) for vdagent. This thread has further details: http://comments.gmane.org/gmane.comp.emulators.spice.devel/11800. – slm Dec 13 '12 at 17:30
  • @slm Your link is about the QXL driver not marked as supported for Win2k8R2, but it just works in you force it (read other replies). It has nothing to do with the guest agent. – gertvdijk Dec 14 '12 at 19:56
  • Yes I saw that in the thread too. I was adding the link as a reference in case anyone else ran into problems that came across this SF question and was using Win2K8R2 as a guest. Additionally even though it will work some people will have issue with having to install a driver that hasn't been officially signed/vetted for their platform. – slm Dec 14 '12 at 20:03