Networknet.nl Blog

Stay Connected

Failed to lock the file! VMWare virtual disk (vmdk)

with 58 comments

I copied one of my Windows XP virtual machine running on a VMWare Server 1.02 host locally to my workstation. After the files were copied I opened the vmx file with VMWare Workstation 6 and received the error below after trying to start the virtual machine. I made one snapshot on the VMWare Server host.

Cannot open the disk ‘C:\VM-machines\Windows XP-001\Windows XP Professional-000001.vmdk’ or one of the snapshot disks it depends on. Reason: Failed to lock the file.

 

clip_image002

Locate the virtual machine in Windows Explorer and delete any .lck folders

image

Start the virtual machine. If this fails try to Map the virtual hard disk to Z:\

image

clip_image008

I than disconnect the virtual hard disk and retried. The virtual machine boot without any problem; my snapshot was valid.

Written by Ivan Versluis

March 12th, 2008 at 5:20 pm

Posted in VMWare

Tagged with , , , , ,

58 Responses to 'Failed to lock the file! VMWare virtual disk (vmdk)'

Subscribe to comments with RSS or TrackBack to 'Failed to lock the file! VMWare virtual disk (vmdk)'.

  1. Thanks! Worked for me.

    –BT

    BT

    27 Sep 08 at 9:34 pm

  2. I virtualized a fisical machine but when i tried to open on workstation i got the same error: failed to lock the file. So i removed the 2 folders .lck but when starting again the machine i get this error: Cannot connect virtual device ide1:1. No corresponding device is available on the host.
    It tries to open but as soon as windows screen appears i get a blu screen! i tried to map the drive to z as you suggested but i get the same error.
    Can you helpme please. thanks

    tex

    29 Sep 08 at 10:57 pm

  3. Thank you for your post, it worked great! thanks for sharing the knowledge!

    Ragu

    22 Nov 08 at 4:15 pm

  4. Works! Great Tip

    kotwun10

    22 Nov 08 at 6:07 pm

  5. Wow i did it. Great thanks.

    Ngo viet yen

    1 Dec 08 at 10:24 am

  6. Worked for me as well!
    thanx

    Simon

    4 Dec 08 at 2:04 pm

  7. Thanks so much for sharing this with us. :)

    anonymous

    30 Dec 08 at 1:33 pm

  8. Yep ty, worked 4 me.

    John

    13 Jan 09 at 12:19 am

  9. tks a lot

    boby2k

    19 Jan 09 at 7:18 am

  10. Very very thanks!

    nye

    23 Feb 09 at 4:18 pm

  11. I had a similar problem after a power outage. In /var/lib/vmware/Virtual Machines/ there are 2 folders which end in .lck. Deleting both of these solved my problem

    Captain Solo

    26 Feb 09 at 5:07 pm

  12. Thanks worked for me as well and I was running Ubuntu on VM not windows!

    Me

    2 Mar 09 at 8:14 am

  13. Worked. Thanks.

    Tarcio

    6 Mar 09 at 3:40 pm

  14. Worked. Thanks.

    Dopu

    11 Mar 09 at 1:29 pm

  15. Thanks… it worked

    belson

    18 Mar 09 at 2:23 pm

  16. You are the best

    P4W3R

    26 Mar 09 at 2:29 pm

  17. Grasia fiera, me rre sirbio

    carlo

    9 Apr 09 at 2:52 am

  18. Renaming the .lck files (safer than deleting until I verified it would work ) worked perfectly for me. I am running VMware Server 2 under an Ubuntu Server v-8.04 64 bit platform, Dell Precision T3400 8Gb RAM machine.

    I had been running several VMware Workstation machines under XP Pro with VMware Workstation v-6.5 with a Dell Vostro 220 4Gb RAM machine, and wanted to migrate the virtual machines to the VMWare Server 2 for better load balancing, and on a higher RAM machine for greater concurrent virtual machine density. Imagine my surprise when the first imported machine worked great. The others did not, until I renamed the .lck files. Your post saved me hours of setting up new virtual machines.

    Thank You!

    Gil

    Gilbert M Hale

    26 Apr 09 at 9:21 pm

  19. Wow, thanks a lot, u saved so much of my time :D

    ruch

    12 May 09 at 11:04 am

  20. Thanks a million that worked :)

    leezo

    13 May 09 at 7:24 pm

  21. ho lo stesso problema ho fatto le seguenti prove:
    ho la vmware server con windows 2003 server su server linux red hat 5 enterprise edition
    1: cliccando su start mi dà l’errore:
    Unable to Power On virtual machine with “A General System error occurred: Internal error”
    2: ps -eaf|grep vmware
    root 26375 19955
    Message from hyperion.sin.it: Cannot open the disk ‘/u03/VMachine/W2k3PLA/W2k3PLA.vmdk’ or one of the snapshot disks it depends on. Reason: Failed to lock the file.
    qual’è il pid è 26375 o 19955
    3: devo fare kill 26375 o kill 19955
    e riavviare la virtual machine?
    aspetto una mail di risposta.
    grazie cordiali saluti
    dott. ugo montorsi

    ugo montorsi

    14 May 09 at 7:30 pm

  22. Thanks a million… worked for me and saved my VM!

    Brian

    28 May 09 at 5:35 pm

  23. Cheers, Works Like A Beauty

    Pallav

    2 Jun 09 at 1:12 pm

  24. thanks

    mj

    8 Jun 09 at 9:24 am

  25. gracias fiera me sirvio mucho ya lo daba por muerto mi maquina virtual

    roly

    19 Jun 09 at 12:20 am

  26. Thanks dude. It worked………

    pk

    27 Jun 09 at 11:03 am

  27. Awesome. You are my hero.

    Jeff

    9 Jul 09 at 3:32 pm

  28. Excellent!!!!! It works for us, thankyou very much!

    Babu

    22 Jul 09 at 2:03 pm

  29. Thanks it worked great for me

    Prasanjit

    28 Jul 09 at 10:17 am

  30. Thanks. It worked for me aswell!

    Jokohanho

    3 Aug 09 at 10:58 am

  31. Great, worked perfectly! Cheers!

    Rich

    6 Aug 09 at 2:46 pm

  32. Nice! It worked!

    Biliballa

    21 Aug 09 at 12:55 pm

  33. Just wanted to add my name to the long list of people who solved their problem from this tip. Thanks.

    Niels Brinch

    27 Aug 09 at 9:22 am

  34. thanks… worked for me too. good job.

    dom

    2 Sep 09 at 3:51 pm

  35. Thanks a bunch!!….You saved so much of my time!

    Mehr

    3 Sep 09 at 10:32 am

  36. Thanks!!

    philip

    3 Sep 09 at 1:18 pm

  37. thanks a lot … it really saved a lot of time .it was great help .

    Prashant

    7 Sep 09 at 4:54 pm

  38. thanks it worked

    totad

    21 Sep 09 at 9:13 am

  39. Thanks, great information, solved my issue :-)

    Klaus

    10 Oct 09 at 11:55 am

  40. muy bien, muchas gracias. Thanks.

    Rherrera

    13 Oct 09 at 6:55 pm

  41. dzieki wszytko dział!
    thx everty thing work

    beny

    20 Oct 09 at 6:48 pm

  42. I’d just like to add my thanks too! I had my heart in my mouth when I thought I’d possible lost yesterdays development work but everything is running again. Thanks!

    Paul

    22 Oct 09 at 12:08 pm

  43. Thanks a lot. It is grate solution.
    When i upgrade from VMServer 1.8 to VMWare Server 2.0, I can’t open my os. I am confuse what i can do, after that i try to find the solution. From this site i get solution. Just i delete the two lock the from vm directory as per recommendation. Thanks a lot.

    Ahasan Kabir

    3 Nov 09 at 6:28 pm

  44. Excelente!!!

    Rigo

    7 Nov 09 at 3:30 am

  45. I ran into the same problem when I moved from VMWare server to VMWare Workstation. Your solution worked for me too. Thanks for sharing!

    Oberon

    13 Nov 09 at 1:57 pm

  46. [...] http://www.networknet.nl/apps/wp/archives/396/comment-page-1 Tags: 3, a, archive, boot, C, di, file, files, il, isc, nt, on, open, PEN, R, server, the, virtual, [...]

  47. The error occurs most of the times because VMware finds a lock directory in the same directory as the VHD.
    The simple solution is to remove this directory (you’ll recognize it by the extension ‘.lck’)
    The error is most likely caused by a wrong shutdown of VMware (either it crashed, or your PC crashed, or you just broke it. whatever applies :P )

    Happy virtualizing~

    Ced

    14 Dec 09 at 1:47 am

  48. Exactly what I needed. Thanks a ton :)

    Bryan

    28 Dec 09 at 8:19 pm

  49. Excellent! That is all i need to know! Worked great.

    Roderick

    29 Dec 09 at 12:46 am

  50. Thanks! ;)

    Zembold

    29 Dec 09 at 4:49 pm

  51. Perfect. Thanks for sharing.

    johnkmx

    5 Jan 10 at 9:08 pm

  52. thanks….it worked

    futureOpen

    19 Jan 10 at 2:53 am

  53. [...] Солюшн нашел здесь Failed to lock the file! VMWare virtual disk (vmdk) [...]

  54. Thank u so much it worked !!!!

    Aswin

    16 Feb 10 at 10:37 pm

  55. thanks

    dani

    28 Feb 10 at 6:07 pm

  56. I am not a vmware techie and know enough to be dangerous…have the lock file situation and understand the fix but do no know how to get to the folders\files on the vm to delete them. Any help greatly appreciated.

    Rob

    6 Mar 10 at 6:09 pm

  57. Thanks, saved my bacon. Otherwise I would have to rebuild the vm’s.

    Ismael

    11 Mar 10 at 2:36 pm

  58. Thanks…!! it works..but I could not understand why it was happened ?

    Sangy

    19 Mar 10 at 6:54 pm

Leave a Reply