03
Dec
Starting a virtual machine generates a syntax error
in VMWare
Comments
Starting a virtual machine generates a syntax error
Details
- The virtual machine fails to power on.
- The .vmx file contains garbled data or is zero bytes long or is corrupted.
- You see the error:“<VM_Name>.vmx” line <x>: syntax error
Solution
This issue occurs if the .vmx file is corrupted. To resolve this issue, either build a new.vmx file or manually repair the existing file.
Creating a new .vmx file
To create a new .vmx file:
- Locate the virtual machine files and delete the .VMX file.
- Open the VMware product or VMware Infrastructure Client.
- Click File > New > Virtual Machine (if listed).
- Follow the new virtual machine wizard making sure to select the Custom configuration installation option. When prompted to create a new virtual hard disk file, choose to specify an existing file. Specify the existing .vmdk file.
Note: For related information when using a Fusion virtual machine, see Creating a virtual machine from an existing virtual disk in Fusion (1023555).
Manually rebuilding the .vmx file
It is possible to reconstruct the corrupted .vmx file provided a copy of thevmware.log is available where the virtual machine started correctly.
To manually rebuild the .vmx file:
-
Locate the virtual machine files. For Fusion, see Locating the virtual machine bundle in VMware Fusion (1007599)
- Open the vmware.log file where the virtual machine started successfully with a text editor. In Macs, use Text Edit.
- Find the line in the log file that contains: — CONFIGURATION. Beyond this line — until the next line that contains — — are the complete contents of the .vmx file as it was parsed by the vmx process.
- Copy the text into a new .vmx file, overwriting the damaged .vmx file.
- From the new file, clean the logging output from the text to restore the original configuration.For example, change the line that reads:
vmx| DICT svga.vramSize = 134217728
To:
svga.vramSize = “134217728”