1. 程式人生 > >虛機打不開報failed to lock the file錯誤原因及解決方案

虛機打不開報failed to lock the file錯誤原因及解決方案

問題出現的原因:

虛擬磁碟(.vmdk)本身有一個磁碟保護機制,為了防止多臺虛擬機器同時訪問同一個虛擬磁碟(.vmdk)帶來的資料丟失和效能削減方面的隱患,每次啟動虛擬機器的時候虛擬機器會使用副檔名為.lck(磁碟鎖)檔案對虛擬磁碟(.vmdk)進行鎖定保護。當虛擬機器關閉時.lck(磁碟鎖)檔案自動刪除。但是可能由於您非正常關閉虛擬機器,這時虛擬機器還沒來得及刪除您系統上的.lck(磁碟鎖)檔案,所以當下次您啟動虛擬機器的時候出現了上述錯誤。

解決辦法一:

   1、在VMware該虛擬機器路徑下的所有.lck檔案和資料夾下刪除或遷移至其它目錄,一般就可以解決了。

   2、如果再次啟動VMware的WindowsVista系統失敗,嘗試右鍵虛擬機器出錯的系統->Settings->Hardware->Hard Disk->Utilities->Map->對映虛擬硬碟到Z:/

   3、斷開虛擬硬碟,重新載入,啟動。系統就可以正常啟動了

經實驗此辦法以失敗結束。如果有遇到Cannot open the disk '*.vmdk' or one of the snapshot disks itdepends on.Reason: Failed to lock the file錯誤的朋友不妨也試一下。如果您實驗成功了,請給我們留言,以便我們進行更好的技術交流

解決辦法二:

   使用記事本開啟*.VMX檔案上加上一行程式碼disk.locking= "FALSE",重新啟動該虛擬機器。

使用方法二,問題得到解決,重新啟動VMware正常啟動,不會再出現Cannot open the disk '*.vmdk' or one of the snapshot disks itdepends on.Reason: Failed to lock the file.錯誤。

VMware “Cannot open the disk ‘XXXXXX.vmdk’or one of the snapshot disks it depends on.”

From time to time, I want to copy just theminimum files for a VMware virtual machine: the two .vmdk files and the .vmxfile. After moving those files to a new location or deleting a snapshot file,attempting to boot the virtual machine returns the following error message:

Cannot open the disk ‘XXXXXX.vmdk’ or oneof the snapshot disks it depends on.

Reason: The system cannot find the filespecified.

I’ve found that following the steps belowfixes the problem and allows me to boot the virtual machine as it existed atthe time of creation. DO NOT USE these steps if you need to retain any changesto the machine:

Open the *.vmx file in a text editor andfind the line that refers to the old snapshot file, which will look somethinglike:

scsi0:0.fileName = “XXXXXX-000002.vmdk”

or

ide0:0.fileName = “XXXXXX-000002.vmdk”

Change the value to the filename of the~1kb .vmdk file (which happens to be the same as the name of the VM). Forexample, if your virtual machine was named “Windows XP Professional”, the linewould read:

scsi0:0.fileName = “Windows XPProfessional.vmdk”

Power on the VM. It should boot normally,but because the snapshot file is missing, the machine will boot to an earlierstate.