A running virtual machine creates lock files to prevent consistency problems on virtual hard disks. Without locks, multiple virtual machines might read and write to the disk, causing data corruption.

Lock files have a .lck suffix and are created in subdirectories in the same directory as the virtual disk (.vmdk) files. A locking subdirectory and lock file are created for .vmdk files, .vmx files, and .vmem files.

A unified locking method is used on all host operating systems so that files shared between them are fully protected. For example, if one user on a Linux host tries to power on a virtual machine that is already powered on by another user with a Windows host, the lock files prevent the second user from powering on the virtual machine.

When a virtual machine powers off, it removes the locking subdirectories and the lock files. If the virtual machine cannot remove these locking controls, one or more stale lock files might remain. For example, if the host system fails before the virtual machine removes its locking controls, stale lock files remain.

When the virtual machine restarts, it scans any locking subdirectories for stale lock files and, when possible, removes them. A lock file is considered stale if the lock file was created on the same host system that is now running the virtual machine and the process that created the lock is no longer running. If either of these conditions is not true, a dialog box warns you that the virtual machine cannot be powered on. You can delete the locking directories and their lock files manually.

Locks also protect physical disk partitions. Because the host operating system is not aware of this locking convention, it does not recognize the lock. For this reason, you should install the physical disk for a virtual machine on the same physical disk as the host operating system.