Some Optimization on Arch Linux VM, Hosted by VMware Workstation
Last updated on 2021-10-28, Thu, 09:00 PM
Foreword
I have been using VMware Workstation
to host my Arch Linux. Well, though I don’t have to take the trouble to handle hardware problems. But in fact, I still have to face some glitches that affect my experience and annoy me.
So I decide to do something to minimize the impact.
Stop Mouse from Jumping to the Edge
The problem occurs when I operate inside the VM.
When I switch from one window to another, or dragging the mouse along the left/right edge of the guest display holding one key, the mouse will blink at a high frequency and suddenly get trapped at 1/3 or 2/3 of the height. I have to move the mouse again for a few seconds to get rid of this.
Well, ArchWiki offers one possible solution. But that doesn’t work for me.
Seemed that the abnormal ungrabbing behavior can’t be fixed. But when I used exclusive mode, such problem stopped taking place. Meanwhile, the reference of this solution points to a problem that concerns mouse ungrabbing. Then I predicted that the only way is to turn off automatic ungrabbing. But in the preferences of VMware Workstation, the switch of auto grabbing and ungrabbing are tied together, they can’t be configured separately. I don’t want to input Ctrl+G
every time I want to kick in.
I found one article here and get to know a trick, which leaves auto grabbing is still active while ungrabbing is disabled.
Typically, when setting preferences in the VMware Workstation
graphical interface, the only way to realize this is to switch on “Gaming Mouse”. But this mode will make the mouse much faster, very hard to control. It’s not comfortable at all.
Then I get to know editing the .vmx
configuration file of the guest machine.
VMware Employee
01-24-2018 12:31 PM
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.
According to that, I just need to add one line to the .vmx
file:
The settings of the individual .vmx
file will override the uniform preference of the VMware Workstation
.
At least it prevents the mouse from sudden jumping. Yet the blinking is not resolved.
I just take the trouble to click Ctrl+Alt
every time I want to ungrab my mouse. Anyway.
Hide Annoying Tips When Entering Exclusive Mode
I found one solution.
This never worked for me using the vmware workstation interface, but you can do it using an HEX editor and modiyfing vmware.exe, so here’s how I did it on Workstation 11.
HxD is a good one for windows.
First, create a backup/copy of your vmware.exe file in program files.
Close vmware workstation.
Open HxD as an administrator and open
vmware.exe
.Once the file is open, search for the ascii string (CTRL+F)
To release
. It should be between the offsets0012A350
@0012A390
.Replace the following bytes by
00
(asciinull
) or2E
(ascii.
):From:
@&!*@*@(msg.vmui.fullScreen.ungrab.tooltip)To release input, press %s
To:.....................................................................
Caution! Do not delete any bytes, replace them. The file must stay the same size.
Yes, it works fine for me.