When attempting to install or update the VMware Tools running in a Windows Server 2012R2 VM, the following errors occur.
vSphere ESXi 7.x
vSphere ESXi 8.x
vSphere vCenter Server 7.x
vSphere vCenter Server 8.x
VMware Tools 11.x
VMware Tools 12.x
An application sets a system-wide environment variable for the Guest OS to a character set (CHARSET) unknown to VMware Tools. This causes the VMware Tools GLib to fail strings/error conversions and causes VMware Tools to crash due to NULL pointer access or uninitialized variables.
VMware by Broadcom is aware of the issue and working on fix to be released in a future VMware Tools update.
Workaround:
Download the attached script and upload it to storage that is accessible by the Virtual Machine
In the Windows Server 2012R2 VMs
Copy the vmtoolsd.cmd file into the VMware Tools installation folder; "C:\Program Files\VMware\VMware Tools\"
The vmtoolsd.cmd script contains the following lines:
@echo OFF setlocal rem prevent wrong environment charset from being used set CHARSET= if not "%1" == "" goto vmusr call "%~dpn0.exe" goto exit :vmusr start "" /B "%~dpn0.exe" %* :exit
Then change 2 registry entries:
HKLM\SYSTEM\CurrentControlSet\Services\VMTools\ImagePath
From
"C:\Program Files\VMware\Vmware Tools\vmtoolsd.exe"
To
"C:\Program Files\VMware\Vmware Tools\vmtoolsd.cmd"
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Vmware User Process
From
"C:\Program Files\VMware\Vmware Tools\vmtoolsd.exe" -n vmusr"
To
"C:\Program Files\VMware\Vmware Tools\vmtoolsd.cmd" -n vmusr"
NOTE: This is only a temporary workaround until a version of VMware Tools can be installed that handles the environment variable correctly.
Any upgrade to Tools versions without a fix would require reapplying the above changes.
Process Monitor logs are helpful in diagnosing the cause of the crash, download the latest version from Microsoft SysInternals
Run the VMware Tools installer and let us know if it crashes. If it crashes:
Enabling debug logging for VMware Tools within a guest operating system
Another utility from Microsoft SysInternals is Process Explorer, which can also help investigate the VMware Tools processes. Run the Procexp[64].exe as Administrator. Once running, you can find the VMware Tools processes by selecting the ribbon filter box “<Filter by name>” and typing the name of the VMware Process to view. This can be:
Once filtered, if nothing is shown, the processes are not running.
If found, you select the process shown and right-click properties. This will show a dialog with many information tabs. Here, the Environment tab is useful, and it should show CHARSET is used or set for the process. If missing, then the variable has been cleared for the process.
Furthermore, in the main application window, select the “View” menu option and “Show Lower Pane”. This will show open handles, loaded DLLs, or threads for the selected process.