HowTo: Recreating a .vmx from the vmware.log file

HowTo: Recreating a .vmx from the vmware.log file

In case a virtual machine configuration (.vmx) file becomes corrupt for whatever reason, you may see error messages like "Not a valid virtual machine configuration file", or "... syntax error in line X" when you try to start the VM.

VMware KB article "Starting a virtual machine generates a syntax error" provides some options for how to resolve such an issue. However, manually recreating the configuration file is somewhat cumbersome. See https://kb.vmware.com/kb/1003597

The attached batch file automates the task of recreating the .vmx file by simply dragging the vmware.log file and dropping it on the log2vmx.cmd file. The script parses the .log file for the required configuration data, and - if this information is found - creates a new .vmx file in the script's folder. If a .vmx file with the same name already exists, it will be renamed to .vmx.bak.

Note: Please be careful if the VM has active snapshots, i.e. that the recreated .vmx file points to the current snapshot .vmdk !

Tags (3)
Attachments
Version history
Revision #:
1 of 1
Last update:
‎11-27-2020 08:26 AM
Updated by:
 
Contributors