21

I am receiving the message:

The process cannot access the file because another process has locked a portion of the file

Cannot open the disk 'C:\Users\t825665\VM's\VPC\Windows 10 x64.vmdk' or one of the snapshot disks it depends on.

Module 'Disk' power on failed.

Failed to start the virtual machine.

So the virtual machine is not starting anymore, how to fix that?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
rod.dinis
  • 1,233
  • 2
  • 11
  • 20

6 Answers6

47

I just found the solution for this issue. I created a backup and moved the 'lck' files from my VM's directory (*.lck), removing them from the VM's directory. Then just restarted the virtual machine.

rod.dinis
  • 1,233
  • 2
  • 11
  • 20
16

To solve this error, please go to virtual O's directory and delete every thing with an ".lck" extension.

LarsTech
  • 80,625
  • 14
  • 153
  • 225
AliReza
  • 161
  • 1
  • 2
  • Any way to script this? My thought is something like if the IP address of the virtual doesn't ping, delete all references to files and folders with the .lck extension. – John Feb 16 '20 at 14:56
8

removing folders with an extension of lck solved the issue for me

user13543779
  • 81
  • 1
  • 1
1

I run the batch file below to delete all temporary files , locks, directories and memory files in the VMWare Working Directory (i.e. Settings/Options/Working Directory). It's got me out of many a jam. You will lose any unsaved work that was in VMWare suspended memory so backup before using if you're not sure. It will reboot the image as if it was shutdown.

--------------------------Clean.bat ----------------

@echo off

REM  - Delete all directories in Working Directory
set dr=%cd%
set ex=\*
set "dr=%dr%%ex%"
for /d %%a in ("%dr%") do rd "%%a" /q /s  

REM - Delete files in Working Directory
del *.log
del *.vmem
del *.vmss
del *.nvram
del *.vmx~
pause
TT.
  • 15,774
  • 6
  • 47
  • 88
Beto Green
  • 11
  • 1
  • Doing a version of this let me force power down a suspended virtual machine. I just went to the VM directory and did the del commands for *.log, *.vmem, etc. – Mike Kelly Aug 11 '21 at 00:20
0

Workstation shut down, delete any *.lck files and folders in the VM folder. Then reopen the Workstation, load the VM, and power on.

Sam
  • 241
  • 3
  • 7
0

For me, it helped, that I started the VM with admin privileges.