优化 Arch Linux 虚拟机,针对 VMware Workstation

Last updated on 2021-10-28, Thu, 09:00 PM

View in English

写在前面

我一直用 VMware Workstation 帮助我在 Win10 环境中使用 Arch Linux.

虽然不用应付实装硬件的问题,但是我经常要解决一些恼人的小麻烦。

鼠标啊,求求你别再乱跳了!

问题来得好突然。

当我在VM里切换窗口,或者按住鼠标沿着屏幕左右边缘移动时,鼠标会快速闪烁,并且在三等分的高度卡住。我得等上好几秒,它才会放出来。

ArchWiki 上提供了 一个方案,但是它不工作。

自动取消抓取的问题似乎没法修了。但在我使用独佔模式的时候,就不会有鼠标乱跳的问题。同时,我注意到,这个方案的原帖提到了鼠标自动取消抓取的问题。我猜,唯一的方法大约是关掉自动取消抓取。然而抓取和取消抓取的设定是捆绑的,没法分别设置。

我找到 一篇文章 ,它介绍了一些比较巧妙的方法,可以把两种设置切割开来。

通常情況下,在 VMware Workstation 图形界面中设置偏好时,实现的唯一方法是打开“游戏鼠标”。但这种模式会使鼠标的速度变快,非常难以控制。这可一点都不舒服。

按照这个人的回答,只要修改虚拟机的 .vmx 文件就可以了。

banackm

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.

我只要给 .vmx file:

mks.gamingMouse.policy = "absgaming"

单个 .vmx 文件的设置将覆盖 VMware Workstation 的统一偏好。

至少可以防止鼠标的突然跳动。然而,闪烁的问题并没有解决。

我只好在每次脱离的时候麻烦地点击 Ctrl+Alt

闭嘴吧,别再弹什麽提示了!

我只找到这一个 解决方法.

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 offsets 0012A350 @ 0012A390.

  • Replace the following bytes by 00 (ascii null) or 2E (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.

它工作。


优化 Arch Linux 虚拟机,针对 VMware Workstation
https://blog.h3a.moe/src/d07410/
Author
H3arn
Posted on
2021-10-28, Thu, 06:33 PM
Updated on
2021-10-28, Thu, 09:00 PM
Licensed under