How to easily recreate vmx file

4

I recently came across an issue wherein I had to recreate vmx file. I thought of sharing it with you all hoping that it will help you as well.

VMX file is the primary configuration file, which stores settings chosen in the New Virtual Machine Wizard or virtual machine settings editor.

If you try to power on the virtual machine, you will see an error similar to below.

recreate vmx file

There are a couple of ways recreating vmx file, the easiest way would be to able to get it from your backup team or try and manually create the file.

There is another way of creating the file that I want to share with you guys today.

We will beĀ using the vSphere Client to perform this activity.

If the Virtual Machine is still part of the inventory, make sure that you remove it by right click on the VM and selecting Remove from Inventory.

We perform this to make sure that there are no conflicts when we try to create the vmx file with the same VM name.

Now you need to open up a New Virtual Machine Wizard and select the Custom Install option.

recreate corrupt vmx file

Next, you need to make sure that the VM name matches exactly to the Virtual Machine directory name on the datastore that is hosting the missing or the corrupt vmx file.

recreate corrupt vmx file

If the name mismatches here, then a new Virtual Machine directory will be created along with the vmx file and other important virtual machine files.

You would then have to select the location on the datastore that you want to store the Virtual Machine. It is best to select the datastore on which the vmdk files are located.

recreate corrupt vmx file

You would then have to go through the normal procedure of providing information like Hardware version, Guest OS type, vCPUs, Network, SCSI controller type.

Be careful when you reach the Select a Disk option. You will have to select the existing disk and point it to the primary vmdk file of the Virtual Machine.

recreate corrupt vmx file

Once you complete the process of creating a new VM, you would then be able to see the new vmx file created in the Virtual Machine directory.

recreate corrupt vmx file

You should now be able to power on the affected virtual machine.

I hope this has been informative and thank you for reading!

Share.

About Author

I am Adil Arif, working as a Senior Technical Support Engineer at Rubrik as well as an independent blogger and founder of Enterprise Daddy. In my current role, I am supporting infrastructure related to Windows and VMware datacenters.

4 Comments

Leave A Reply