I recently faced an issue with one of my VMWare virtual machine that when I try to run this virtual machine it did not work. VMWare display this message that “Could not open virtual machine: .vmx. ".vmx" is not a valid virtual machine configuration file.”
Could not open virtual machine: G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx.
"G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx" is not a valid virtual machine configuration file.
I try to open .vmx file [G:\VPC\RakhiQAXPProfQtp\Windows XP Professional.vmx] in notepad then I found it was empty (0 KB).
I wanted to resolve it quickly so I try following method and it worked very well. But this is not a valid documented process so please try with caution. Following are the steps
1. First of all go to the folder where you have your virtual machine and delete all .lck folders.
Windows XP Professional.vmdk.lck
Windows XP Professional-000001.vmdk.lck
Windows XP Professional-000002.vmdk.lck
2. Open the .vmx file. In my case it was empty and 0KB.
3. Copy the content from any other .vmx file that you may have. This could be from a backup or from other virtual machine you may have. Let me know if you do not have any so I can send one to you.
4. Change following line in the file
scsi0:0.fileName = "Windows XP Professional-000001.vmdk"
displayName = "Apps - Windows XP Professional - QTP"
nvram = "Windows XP Professional.nvram"
extendedConfigFile = "Windows XP Professional.vmxf"
To get this value “scsi0:0.fileName = "Windows XP Professional-000001.vmdk"” you need to open Windows Explorer with detail view. Sort the folders & files by recent date and copy the name of the most recent .vmdk file. See the picture below and you will notice that in my case it was "Windows XP Professional-000001.vmdk". Other values are self explanatory but if you have any question then post a comment & I will respond back with particular details.
Following line should also be changed but I could not find the correct value for it. So I left it like this.
ethernet0.generatedAddress = "00:0c:29:1d:4b:3f"
5. After you done editing, save & close the file.
6. Open VMWare and try to open the virtual machine. It it show you a message (I forgot to take screen shot of that message). The message will say something like this “Did you copy or move this virtual machine.” It will give you two options to chose from. 1. Copy & 2. Move. Select Copy option and Do not select move option. If you select move option then VMWare will not generate new SID & other keys.
7. That it. It should open your VMWare virtual machine and you should be good to go.
There are many other methods too that you can try to resolve this issue.
1. Create a new virtual machine & attach the existing .vmdk file: Create a new virtual machine with custom (advanced) configuration option and chose “I will install the operating system later”. Later in the new virtual machine wizard chose “Use an existing virtual disk”. This will allow you to browse and select your existing virtual disk. While browsing for file remember to sort the folders & files by recent date and then select the most recent .vmdk file.
2. Recover vmx from log file: Following pages describe this process.
3. Recreate vmx file: Following pages describe this process.