Investigating Virtual Machine lock files
search cancel

Investigating Virtual Machine lock files

book

Article ID: 340620

calendar_today

Updated On: 03-05-2025

Products

VMware vSphere ESXi 7.0 VMware vSphere ESXi 8.0

Issue/Introduction

Purpose: Provide guidance in determination of whether the existence of lock files prevents a Virtual Machine to be able to power on.

 

Potential Symptoms:

  • Virtual Machine does not start
  • Virtual Machine cannot be booted

 

Potential Error Messages observed:  

  • Cannot open the disk or one of the snapshot disks it depends on
  • Failed to lock the file
  • The virtual machine is already powered on
  • Error while opening the virtual machine: no permission to access this virtual machine
  • Check for missing files failed.
  • Your host's BIOS does not have valid NUMA information. Please update the host's BIOS or associate the virtual machine with the processors in a single NUMA node (CEC).

 

Environment

ESXi 7.x
ESXi 8.x

Resolution

There are some circumstances in which one or more lock files exist in a Virtual Machine's directory even though the Virtual Machine is powered off.
When this occurs, the only way that the Virtual Machine can be powered on is to manually remove these lock files by following these steps:
 
 
Note: Do not delete any lock files associated with a Virtual machine which is powered on. This could result in unrecoverable data loss.
 
 
3.) Delete any file/folder/directory that ends with either .lck or .LOCKFILE.
Note: Before deleting, take a Backup of the affected file/folder(s)
 
4.) Delete
In the directory where the lock file exists, type rm <filename> , where <filename> is the name of the file, and press Enter.
Note: If it is a directory, then type rm -rf <directory> , where <directory> is the name of the directory, and press Enter.

 

Additional Information

Lock files are created when a Virtual Machine is powered on.
Their purpose is to prevent multiple VMware processes from accessing the same Virtual Machine at the same time.
The existence of a lock file indicates to VMware that the associated Virtual Machine is powered on.
If a lock file exists, and an attempt is made to power on the Virtual Machine, VMware will prevent this and an error message will be displayed.
The exact error message will vary, depending on the nature of the lock file, the product in use, and the version of the product.
 
Lock files are most often located in a Virtual Machine's directory in error when the Virtual Machine was shut down unexpectedly
and the VMware product in use did not have time to perform the normal routine removal of these files.