Have you noticed that for a powered on virtual machine in vSphere 5.1, there is now an additional VMX file that ends with an ~ (tilde) found within the virtual machine's configuration directory?

This was an observation that was made by a few folks and some thought it might be related to a virtual machine's lock file which is created when a virtual machine is powered on. After a bit of research, it turns out this extra VMX file is not a lock file but actually an "edit file". This edit file is a copy of the original VMX file and when changes are required, they are applied to the edit file first. Once the changes are complete, the edit file is then atomically swapped with the original VMX file which helps prevent potential VMX file corruption. In the worst case event where the original VMX file is somehow corrupted, the virtual machine can be restored using the edit file.

This is another reason why you should not be manually editing a virtual machine's VMX file, especially when it is still powered on. For any VMX configuration changes, you should be automating using the vSphere API through the use of either PowerCLI or the vSphere SDK for Perl. For more information on automating advanced settings across your virtual machines, please take a look at this article.

Category: Uncategorized Tags:

4 thoughts on “Why Are There Two VMX Files?

  1. Hi William
    Yet another interesting article on your blog. Thanks for sharing.
    Maybe you could point out that the duplicate vmx~ only exists while a VM is in powered on state.
    You say we should not manually edit VMX Files. True, if you don’t have a backup of it. But who (except for Chuck Norris) is editing VMX files manually during runtime anyway? 😉

Thanks for the comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.