Recreating a lost or deleted vmx file
search cancel

Recreating a lost or deleted vmx file

book

Article ID: 341647

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to recreate the virtual machines which are showing as Orphaned or Inaccessible. The .vmx configuration file can be recreated that is corrupted or deleted, while the virtual disk files (.vmdk) still exists without any corruption or broken/missing snapshot chain.

Environment

VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.7
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x

Resolution

To resolve this issue, create a new virtual machine and add the existing virtual disk (.vmdk) file to the newly created VM.

Note: This process creates a new MAC address for the network card(s) and may cause issues with software that is dependent on a virtual machines MAC address.

To create a new virtual machine configuration file and point it to the existing .vmdk file:

  1. Log in to the HTML5 web client as an administrator.
  2. Right-click the affected virtual machine and click Remove from Inventory.                                                              
  3. Right-click an ESXi host.
  4. Click New Virtual Machine.
  5. Select Create a new virtual machine.
  6. Go through the Create New Virtual Machine wizard selecting the same/similar settings of the original VM.
  7. Select Add New Device > Existing Hard Disk and browse to the .vmdk file (add additional Hard Disks as needed).
  8. Complete the Create New Virtual Machine wizard.

This procedure recreates the configuration file (.vmx) for the virtual machine and other supporting files. You can now start the virtual machine from the Inventory of the vSphere Client.

Note: Although there are differences in the GUI, the same logic can be used in older versions of ESXi.

For a scripted method, reference Rebuilding the virtual machine's .vmx file from vmware.log.
For more information, see: