Skip to content

Instantly share code, notes, and snippets.

@cocafe
Last active October 20, 2024 15:16
Show Gist options
  • Save cocafe/d3b4e286af68925d45fcb2c7337cf673 to your computer and use it in GitHub Desktop.
Save cocafe/d3b4e286af68925d45fcb2c7337cf673 to your computer and use it in GitHub Desktop.

VMware VMX Notes, Performance Tweaks, Interactivity Improvements

experimented on VMware Workstation 15.5.2 build-15785246, other verisons may not work, no guaranteed.


global config for all VMs

C:\ProgramData\VMware\VMware Workstation\config.ini

resume/suspend VM asap

if you have mere host RAM amount, do not use prefvmx.minVmMemPct=100

# add to global config to apply to all VMs
prefvmx.minVmMemPct = "100"
mainMem.useNamedFile = "FALSE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"

spoof guest OS that it's inside real machine

these tweaks will break VM tools ability to communicate with host, but it can actually fix weird random freezes since Workstation 12+, confirmed.

monitor_control.virtual_rdtsc = "false"
monitor_control.restrict_backdoor = "true"
isolation.tools.getPtrLocation.disable = "true"
isolation.tools.setPtrLocation.disable = "true"
isolation.tools.setVersion.disable = "true"
isolation.tools.getVersion.disable = "true"
monitor_control.disable_directexec = "true"

update:

random freezes:
if a picture or video is in Windows clip-paste buffer, then vmware is likely to freeze.
somebody reported this in vmware community already, but it looks like no fix right now (vmware 16).
just closed vmware window forcely and Ctrl+C some plain texts, then open vmware again. this will fix that freeze.
configs above accidentally fix this freeze by disabling vmware tool (clip-paste sharing) in guest OS.

spoof guest OS - more

monitor_control.disable_directexec = "true"
monitor_control.disable_chksimd = "true"
monitor_control.disable_ntreloc = "true"
monitor_control.disable_selfmod = "true"
monitor_control.disable_reloc = "true"
monitor_control.disable_btinout = "true"
monitor_control.disable_btmemspace = "true"
monitor_control.disable_btpriv = "true"
monitor_control.disable_btseg = "true"

spoof macOS guest

board-id.reflectHost = "FALSE"
board-id = "Mac-BE088AF8C5EB4FA2"
hw.model.reflectHost = "FALSE"
hw.model = "iMac18,3"
serialNumber.reflectHost = "FALSE"
serialNumber = "C02TC4YKJ1GJ"
smbios.reflectHost = "FALSE"
efi.nvram.var.ROM.reflectHost = "FALSE"
efi.nvram.var.MLB.reflectHost = "FALSE"
efi.nvram.var.ROM = "3c0754a2f9be"

improve interactivity (greatly)

confirmed on hosts with GTX1070 and RX580, win7 and ubuntu 18.04 guests.

interactive response latency is reduced greatly, no more choppy guest screen.

these tweaks probably add some overheads to host machine.

use with caution if host machine has poor performance (not tested yet).

mks.lowCompositingFPS="60"
mks.maxCompositingFPS="1000"
mks.skipHookTimeoutCheck="TRUE"
mks.updateCoalescePeriodUS="0"
svga.readbackRegionComplexityLimit="512"
mks.requireHardwareRenderer="TRUE"
  • mks.lowCompositingFPS="60" : default: 10, lower limit?
  • mks.maxCompositingFPS="1000" : default: 100
  • mks.skipHookTimeoutCheck="TRUE" : default: FALSE
  • mks.updateCoalescePeriodUS="0" : default: 16666" (16.666ms, 60Hz), 0 : latency reduces greatly
  • svga.threadPollUS="1000" : default: 10000, 1000 to reduce latency, may be laggy due to overhead
  • mks.vdpMinFrameDelayMS="0" : default: 28
  • svga.noThreadSleep="TRUE" : default: FALSE, TRUE can hog one logical host CPU 100%, use with caution
  • svga.readbackRegionComplexityLimit="512" : default: "64", 512 improves FPS of program inside VM

other tweaks that may affect interactivity

  • mks.vsync="1": default: 1, 0 feels choppy, because vsync is off
  • mks.allowAcceleratedRenderers="TRUE": default: "default", may allow to switch backend hw-acc renderer
  • mks.win32.timerResolution="500": default: 0
  • mks.dx11.enableModernPresentation="TRUE": default: FALSE, TRUE feels laggy

placebo thing

this tweak can be found while googling improve vmware interactive things, but it is deprecated in modern Workstation

# default: 4, 100/4=25hz, maximum: 1
svga.maxChangeTick = "1"

tweaks that did not confirmed

svga.maxFullscreenRefreshTick= # default: "-1" ???
svga.threadPollPendingFencesUS= # default: "100"
svga.maxFenceAgeUS= # default: "100000"
svga.traceFBCoaleseUS= # default: "10000"
mks.dx11.waitForQueryYieldMS= #default: "1" 
mks.forceDiscreteGPU= #default: "FALSE"
@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Jul 19, 2021

do you have any updates for version 16? Thanks!

@cocafe
Copy link
Author

cocafe commented Jul 20, 2021

do you have any updates for version 16? Thanks!

here is the way i used to experiment hidden configs:

use string utility to extract ascii strings from vmware-vmx.exe or vmware-vmx-debug.exe,

then use grep and sort to find strings which look like config (for example, strings contain .)

and then, put the config strings in to vmx, with wrong value, like mks.forceDiscreteGPU=balabala

and boot the vm, vmware will pop up this invalid config with proper range, value type (number or text) and default value.

IDA pro may help, to analysis the code logics of config values (like branches of value -1, 0 ...)

feel free to experiment by yourself.

for now, i only add this line to .vmx and works perfectly on 16 currently ;)

(i was looking for some configs vsync or fps limiter related and found this worked)

mks.updateCoalescePeriodUS="0"

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

nice tricks. Are there any other configs needed to make the vm have vsync on other than the above one (mks.updateCoalescePeriodUS="0") ?

@cocafe
Copy link
Author

cocafe commented Jul 21, 2021

nice tricks. Are there any other configs needed to make the vm have vsync on other than the above one (mks.updateCoalescePeriodUS="0") ?

mks.updateCoalescePeriodUS="0" is just good enough, interactivity responsiveness is obviously improved which is satisfying me (i used to code and work on ubuntu vm daily). vsync of vmware window is still likely on, tested some game inside guest vm before, did not notice any tearing...

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

i tried with the mks.updateCoalescePeriodUS and also combined with other configurations but cannot get vsync working. when moving a window i still see tearing even if fps is ok for games for example (i have an rtx 2060)

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

i am simply powering off and starting the vm again. This is supposed to reload the config vmx right? What could i be missing?

@cocafe
Copy link
Author

cocafe commented Jul 21, 2021

i tried with the mks.updateCoalescePeriodUS and also combined with other configurations but cannot get vsync working. when moving a window i still see tearing even if fps is ok for games for example (i have an rtx 2060)

have you tried to remove all custom configs to check whether vsync is still working?
how about forcing vsync ON in nvidia control panel for mksSanbox.exe vmware.exe and vmware-vmx.exe? i am not sure this works or not, since my 1070 just burned out few months ago.
and i am not sure you have mistaken tearing and vsync tearing (horizontal tearing lines, like the picture demonstrates below).

image

i just recorded a video with a 6900xt, and you can see there is no horizontal tearing and it's smoother than default configs. ;)

unknown_2021.07.21-19.32.mp4

i am simply powering off and starting the vm again. This is supposed to reload the config vmx right? What could i be missing?

yep, just turn off vm, edit the vmx file and save, power on vm, that will do the job.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

I tried all combinations.. for me it looks like a placebo effect. What I observed however is that vsync actually activates when going fullscreen. I also changed setting to have high priority when mouse is grabbed inside vm (might help). I tried recording a video with my tearing in windowed mode, but the recording itself looks smooth :)

@cocafe
Copy link
Author

cocafe commented Jul 23, 2021

I tried all combinations.. for me it looks like a placebo effect. What I observed however is that vsync actually activates when going fullscreen. I also changed setting to have high priority when mouse is grabbed inside vm (might help). I tried recording a video with my tearing in windowed mode, but the recording itself looks smooth :)

btw, what is your guest os? win10 guest os is laggy.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

yes win 10. my intention is to eliminate tearing (enable vsync) and increase performance for games

@eebssk1
Copy link

eebssk1 commented Nov 14, 2021

It's a known problem that enable 3d acceleration makes window tearing on moving(both on windows and linux.). Too bad Vmware does not give a shit on this.
I'm using pro 16.2.1 and tried force vsync for mksSandbox.exe and vmware-vmx.exe, no luck.

also "mks.vsync" is useless on 16.2.1. I decompiled vmware-vmx with ghidra,there's no such string being used.

UPDATE: vmware 16 automatically enables vsync when running in full screen mode.

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

is there any way to have it enabled while not in full screen? and tbh... even if i see visible improvement in full screen it's still not silky smooth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment