Is it possible to automatically grab and ungrab the cursor for a single VM?


I'm running a couple of guest VMs which have edge-activated panels which require me to hover over the screen edge to activate them. With automatic cursor grabbing / ungrabbing this is really painful, so when using these machines I disable the global "Edit > Preferences > Input > Automatically grab and ungrab the mouse cursor".

The problem is that I have a bunch of other machines where I would like use the automatic grabbing / ungrabbing. I've tried different settings for the "Optimize mouse for games" option, but with no luck.

So I'm wondering if there is any option in the vmx file (or any other way) to override the global setting for an individual VM?

If not, is there any possibility of moving this option from the global settings to an individual VM setting in the future?


0 Kudos
1 Reply
VMware Employee
VMware Employee

I don't believe there is any UI for that, but you can hard-code the "Gaming Mouse" setting on a per-VM basis by setting config options in your vmx file.  These will override the UI policy for gaming mouse, and can force the motion grab/ungrab support to be disabled.

The "mks.gamingMouse.policy" vmx-file entry will override the UI's "Gaming Mouse" policy, and can be set to any of the following:

# Equivalent to "Automatic" in the UI

mks.gamingMouse.policy = "dynamic"

# Equivalent to "Always" in the UI

mks.gamingMouse.policy = "gaming"

# Equivalent to "Never" in the UI

mks.gamingMouse.policy = "absolute"

# Doesn't have a UI equivalent, but disables motion grab/ungrab while keeping the accelerated cursor (like "Never")

mks.gamingMouse.policy = "absgaming"

# Doesn't have a UI equivalent, but forces the unaccelerated mouse (like "Always") without disabling motion grab/ungrab

mks.gamingMouse.policy = "relative"

So, if you turn motion grab/ungrab on in the UI, you can set the gaming mouse in each of your VMs with that setting to do what you want.  Or if you have VMs that you still need to be able to toggle the "Gaming Mouse" state (ie for application compatibility) you can leave them with no extra config settings and the global UI "Gaming Mouse" state will keep working.

0 Kudos