Starting a virtual machine generates a syntax error
search cancel

Starting a virtual machine generates a syntax error

book

Article ID: 341451

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor VMware vSphere ESXi

Issue/Introduction

  • 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


Resolution

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.

Restore from backup

If available, restore the .vmx file from the backup.

Creating a new .vmx file

To create a new .vmx file:

  1. Locate the virtual machine files and delete the .VMX file.
  2. Open the VMware product or VMware Infrastructure Client.
  3. Click File > New > Virtual Machine (if listed).
  4. 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 the vmware.log is available where the virtual machine started correctly.
 
To manually rebuild the .vmx file:
  1. Locate the virtual machine files. For Fusion, see Locating the virtual machine bundle in VMware Fusion (1007599)
  2. Open the vmware.log file where the virtual machine started successfully with a text editor. In Macs, use Text Edit.
  3. 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.
  4. Copy the text into a new .vmx file, overwriting the damaged .vmx file.
  5. 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"

     
  6. Save the file and start the VMware product or re-register the virtual machine in an ESX host.
 
Note:The old vmx file can be deleted/removed.

Additional Information

For translated versions of this article, see: