Investigating hosted virtual machine lock files
search cancel

Investigating hosted virtual machine lock files

book

Article ID: 340620

calendar_today

Updated On:

Products

VMware VMware Desktop Hypervisor

Issue/Introduction

This article guides you through the process of determining if any lock files are preventing a virtual machine from being powered on.

Symptoms:
  • Your virtual machine does not start.
  • You cannot boot your virtual machine.
  • You see one of these errors:
    • 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).


    files-locked locked-vm-files lock-files non-deleted-lock-files vm-locked

    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 the lock files.
     
    The following steps provide information on how to remove lock files that are preventing a powered off virtual machine from powering on:
     
    1. Verify that the virtual machine is powered off. For more information, see Investigating if a hosted virtual machine is powered on (1003844).

      Warning: It is very important that you do not delete any lock files associated with a virtual machine if it is actually powered on. Doing so interferes with the virtual machine and may result in unrecoverable data loss.

       
    2. Navigate to the location of the virtual machine's files. For more information, see Locating a hosted virtual machine's files (1003880).

      Note: If different, the locations of the virtual machine configuration (.vmx) file as well as of all of the virtual disk files need to be checked in the following step.

       
    3. Look for and delete any file, directory, or folder that ends in either .lck or .LOCKFILE . Please take a backup of the file before deleting until the issue is confirmed fixed.
       
      • If you are at a Windows command prompt and in the directory where the lock file exists, type del <filename> , where <filename> is the name of the file, and press Enter.

        Note: If it is a directory, then type rd <directory> /s , where <directory> is the name of the directory, and press Enter.

         
      • If you are at a Linux shell prompt and 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.