VMware Error: Cannot open the disk ‘…../VMWare/Windows 7/Windows 7-000002.vmdk’ or one of the snapshot disks it depends on. Reason: Directory not empty.

 

Just run after a VM host crash into the following error when trying to restart the VM.

“Cannot open the disk ‘…/VMWare/Windows 7/Windows 7-000002.vmdk’ or one of the snapshot disks it depends on.

Reason: Directory not empty.”

Resolution:

No Panic. Go to the Directory where the files are located.

# ls -al       to show the content of the directory.

You probably see something like this.

total 44G
drwxrwx— 7 4.0K .
drwxrwx–T 5 4.0K ..
-rwxrwx— 1 2.0G 564db544-bc20-775d-7ebe-35a1a7ba303b.vmem
drwxrwx— 3 4.0K caches
-rwxrwx— 1 4.0M vmmcores-1.gz
-rw-r—– 1 61K vmware-0.log
-rw-r—– 1 61K vmware-1.log
-rw-r—– 1 61K vmware-2.log
-rw-r—– 1 61K vmware.log
-rw-rw—- 1 924M Windows 7-000001.vmdk
drwxrwx— 2 4.0K Windows 7-000001.vmdk.lck
-rw-rw—- 1 2.9G Windows 7-000002.vmdk
drwxrwx— 2 4.0K Windows 7-000002.vmdk.lck
-rwxrwx— 1 8.5K Windows 7.nvram
-rw-rw—- 1 30K Windows 7-Snapshot3.vmsn
-rw-rw—- 1 30K Windows 7-Snapshot4.vmsn
-rwxrwx— 1 40G Windows 7.vmdk
drwxrwx— 2 4.0K Windows 7.vmdk.lck
-rw-rw—- 1 907 Windows 7.vmsd
-rwxrwx— 1 4.3K Windows 7.vmx
-rwxrwx— 1 367 Windows 7.vmxf
drwxrwx— 2 4.0K Windows 7.vmx.lck

Assuming that in a shared environment no other host is running or has suspended the VM you can remove all the .lck files and directories which were not removed due to the crash but are locking the start-up of the VM.

# rm -rf *.lck

You should now be able to start the VM.

Disclaimer:
I’ve done that now for several times (note to myself: find out why the hell the dev host crashes so often recently) but I advise to make a new backup of the data and to have a recent one handy in case you remove more than needed or the vmdk has been corrupted.

%d bloggers like this: