Technical

How to disable the mouse grab and use local cursor only for VirtViewer?

How to disable the mouse grab and use local cursor only for VirtViewer?

How to disable the mouse grab and use local cursor only for VirtViewer? It’s the grab-keyboard=off setting in remote-viewer’s config file. Took me a while to find because the man page buries it.

Steel cabinets with yellow labels for organization in an interior setting.

The setting

remote-viewer reads /etc/virt-viewer/settings or ~/.config/virt-viewer/settings. Add this line:

[virt-viewer]
grab-keyboard=off

That stops the mouse grab entirely. Your local cursor stays local, no more clicking inside the VM window to capture it. Annoying as hell when you’re switching between the VM and your other windows.

Why it grabs by default

VirtViewer grabs the mouse so the guest gets absolute pointer coordinates. Without it, the cursor drifts. But for Proxmox VMs over SPICE, the local cursor works fine if you don’t need precise positioning inside the guest. I’d rather have my cursor back.

Vibrant abstract digital art featuring geometric blocks with LED light effects in a network pattern.

Persistent config

The settings file persists across sessions, so you don’t have to pass –grab-keyboard=off every time. If you launch remote-viewer from Proxmox’s web UI, it still reads this file. Tested on a Proxmox 8 host with a Debian 12 VM.

If you’re dealing with a jumpy cursor instead, check Proxmox SPICE Mouse Acceleration Bug: Fix the Jumpy Cursor.

If you’d rather pay for this

No real paid product fixes a mouse grab setting. It’s a one-line config change. Don’t waste money on a third-party remote desktop tool for this.

Leave a comment

Comments are reviewed before they appear. Your email is never published.