VMware Communities
crourk
Contributor
Contributor

.vmx file corrupt after editing.

Every time I edit a vmx file and save it back I get a corrupt file error when I try to launch the VM.

i Have tried several different txt editors and still they are all corrupt. I rebuild the vmx from the log file and at least I can get the original config running but I need to edit the file.

i have searched high and low and can’t find an answer.

what Is the trick?

thanks,

Chris

Reply
0 Kudos
9 Replies
a_p_
Leadership
Leadership

Which exact VMware product/version/build do you use?

What exactly is the error message you get?

Did you make sure that the .vmx file is being re-read by the VMware product after editing?

Please attach the original, and the modified .vmx file to a reply post.


André

Reply
0 Kudos
StephenMoll
Expert
Expert

Line endings?

Windows wreaks havoc with line endings. I don't know about Workstation, but ESXi is very fussy if you mess with any apparently text based file using an application in Windows.

Notepad++ turned out to be the tool of choice for this, making sure that Edit > EOL Conversion > Unix (LF) is selected.

Also take care transferring the file. When transferring to ESXi using WinSCP transferring files as "Binary" files rather than "Text" files was necessary... go figure. For Workstation I would imagine the transfer to be much simpler.

crourk
Contributor
Contributor

Thanks for replying and Andre'

I am using VMWare Workstation 12 Pro build 12.5.9 build-7535481

My host server is Windows 2012 R2

After I edit the vmx file and save it, upon attempting to power on the vm, I get an error that says the vmx file is corrupt and to remove it by using the remove button in the dialog box.

If I try to reopen the file by either dbl clicking the vmx or the  >File>Open method, nothing happens and there is no error.

I have even installed an SSH server on the windows host and used WinSCP to transfer the file in binary to a workstation where it is edited and then transferred back as binary. The end result is still a vmx file corrupt error when I attempt to power on the vm.

The reason I am editing the vmx file is due to a VT-x/EPT issue as I am running all of this on an older Dell 2900 server with Xeon 54xx processors. I am trying to virtualize a vsphere environment in my home server.

I used to edit vmx files in my former job all the time using the same method and never encountered this issue before. Of course back then we were using version 4.x or 5.x, (cant remember exactly) in the environment.

I just want to know what I am doing wrong. :smileyconfused:

Reply
0 Kudos
continuum
Immortal
Immortal

Use WinSCPs embedded editor. That one is clean and does NOT corrupt any line-endings.
Transfering vmx-files as type "binary" smells like trouble - dont do that.
Anyway - you really should show us a pre-edit vmx and a post-edit vmx.
The most reasonable explanation for this is simply a bad syntax.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
StephenMoll
Expert
Expert

Odd, I've seen more problems when transferring text files from Windows machine to ESXi using WinSCP in text mode. Never had problems when using binary.

Reply
0 Kudos
crourk
Contributor
Contributor

Thanks for all the replies.

It looks like its working now using the embedded editor in WinSCP.

Not sure why it works now so it must have been me. It has been a while since I have worked with stuff.

Thanks again.

Reply
0 Kudos
pkbutler
Contributor
Contributor

I copied and pasted the VMX file into a Linux VM using VI and then copy and pasted back into the Win11 file using Notepad and achieved the same effect.  It then picks up your changes without error.

VMware should really modify their code to allow for Windows file handling for instances running on Windows.

Reply
0 Kudos
RDPetruska
Leadership
Leadership


@pkbutler wrote:

VMware should really modify their code to allow for Windows file handling for instances running on Windows.


I only have Windows hosts, and have almost never had any issues with this in the 20 years I've been running Workstation and Player.  Notepad, notepad++, other basic editors all work just fine.  

Reply
0 Kudos
louyo
Virtuoso
Virtuoso

Linux hosts here. Text editor works fine. Ever since Workstation 4.0 anyway. 

Reply
0 Kudos