Error: "Cannot open the configuration file" when trying to power on VM
search cancel

Error: "Cannot open the configuration file" when trying to power on VM

book

Article ID: 308383

calendar_today

Updated On: 04-09-2025

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms:

  • Powering on a virtual machine fails
  • Cannot power on a virtual machine
  • You see this error:

    Cannot open the configuration file /vmfs/volumes/datastore/virtual machine.vmx.

    An error occurred while creating temporary file for /vmfs/volumes/datastore/VM directory/VM name.vmx: The file already exists.

Environment

  • VMware vCenter Server 7.0.x
  • VMware vSphere ESXi 7.0.x
  • VMware vCenter Server 8.0.x
  • VMware vSphere ESXi 8.0.x

Cause

This issue occurs if the .vmx~ file created while powering on the machine continues to remain on the datastore even after the virtual machine is powered off.

Resolution

To resolve this issue, delete the.vmx~ file:

  1. Open an SSH session to the host that the virtual machine is registered to
  2. Confirm that there is a .vmx file which ends in ~: vm name.vmx~

    cd /vmfs/volumes/datastore/VM directory
    ls -lrt


  3. Confirm that all virtual machine files are not locked:

    touch *

  4. If a virtual machine file is locked determine what may be locking the file: Investigating Virtual Machine file locks on ESXi Host(s).
  5. Confirm the virtual machine is registered to the host:

    vim-cmd vmsvc/getallvms

  6. Get the current state of the virtual machine in question from the host directly:

    vim-cmd vmsvc/power.getstate <vmid from step 3>

  7. Confirm that the virtual machine cannot be powered on:

    vim-cmd vmsvc/power.on <vmid from step 3>
  8. List the virtual machine directory:

    ls -lrt

  9. Rename the temporary file causing the power on failure:

    mv vm name.vmx~ vm name.vmx_bak

  10. Power on the virtual machine:

    vim-cmd vmsvc/power.on <vmid from step 3>

 

Additional Information