Networknet archive Blog

VMware VMDK: Failed to lock the file

Originally published Last updated 297 comments

I copied a Windows XP virtual machine from a VMware Server 1.02 system to my local workstation. After the files were copied, I opened the vmx file in VMware Workstation 6 and received the following error when I tried to start the virtual machine. It had one snapshot on the VMware Server.

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

Remove the lock folders

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

image

Start the virtual machine. If it fails to boot, try mapping the virtual hard disk to Z:\, for example.

image

clip_image008

I then disconnected the virtual hard disk and tried again. The virtual machine booted without any problems, and my snapshot was still valid. Deleting the .lck folder saved me a lot of work.

294 comments

Comments from the original WordPress site, kept read-only.

  1. tex

    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

  2. Captain Solo

    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

  3. Gilbert M Hale

    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

  4. ugo montorsi

    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

  5. Paul

    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!

  6. Ahasan Kabir

    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.

  7. Oberon

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

  8. Ced

    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~

  9. Rob

    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.

  10. Sean Taylor

    Thank you very much. I have just deleted the .lck folders and I could power on my Virtual Machine. Do you know why this situation could happened?

  11. Duncan

    Thank you very well written guide solved the problem in seconds (my computer had crashed whilst the VM was running).

  12. alex

    I have deleted the .lck folder and now it still would not work it shows another error (Cannot open the disk '..-..') Reason: The specified virtual disk needs repair. and when i restore those folders back it shows me the first error message ( Failed to lock the file.)

    and it doesn't let me to change the drive Letter i believe due to the error

  13. Alin


    bangjon:

    okay it’s work. with only remove .lck folder. thanks brother

    THANX!!!
    I'm a newbie in VMware but that think worked smooth !

  14. ES

    What happened was that my PC was abruptly shut down because of a power surge, so the VMware didn't have time to unlock the file.
    And by deleting those files, the VMware will automatically create new ones to supress the old deleted ones.
    Everything should be OK like old files and configurations you had prior to the incident.

  15. terence

    Thanks, thanks, thanks very much; I cloned my 120gb drive to 250 on SUSE and after, i thought i lost my CCNA stuff, I followed you recommendation and i am back in business, thanks again.

  16. Brownguy24

    WOW This saved me from recreating the vm i thought i had lost.. thanks a bunch!! :D, although i have to ask.. what are the folders with the .lck for anyways? and is there any effect in the long run if they are removed?

  17. Mike

    hey thanks a lot. i salvaged the vm image from a bad raid 0 array and i thought its a gonner

  18. WindowsPistha

    Saved my work ! Thank you !

    Instruction can be improved a little better. Thank you !

  19. AZEEM

    Thanks buddy... It really worked out without any problem. Saved a lot of work, don't have to re-do the whole stuff of doing the re-installation of VM.

    Many many thanks.

  20. Huviel

    Thank you for that tip !

    I was dealing with this problem for hours !

    Thx !

  21. Techdude27

    Thank you very much !!!

    Your solution solved my problem with my virtual machice..

  22. Anett

    Thanks a lot, I could solve my problem without my husbands help! He will be very proud of me!

  23. Brian

    Thank you! i was stuck all day not being able to get into my work VM!

  24. A.Jesin

    My physical machine was unresponsive and I had to reset it. After that when I tried opening the Virtual Machine I was receiving the same error, but just deleting the *.ick folders solved the problem thanks a lot.

  25. Timo

    Thanks! That is a tip that is worth it's weight in gold your a champ in my book!

  26. camila

    Thank u!!!! Is working great now!!!! You saved my weekend! I was desperate when i saw that mensage.

  27. Brett

    That it is actually a nice beneficial bit of info. I'm glad that you shared this valuable information along with us. You should keep informed similar to this. Thanks for sharing.

  28. Amit

    Thanks Alot bro
    u saved me. It was scary.

    thanks a lot for sharing with such a solution with easy to understand.

  29. Vissu

    Thanks a lot that saved me a lot of time and also i thought i had to re create a virtual machine .
    Thank u

  30. b.yasser

    tank youuuuuuuuuuuuuu man !!!! that help me alooooooooooooot tannk uuuuuuuuuu

  31. Vicken Avedian

    Thank you you really saved me, I brought my work home when I finished and brought back to work I got this message I had no idea what it was. when I saw your site wow thank you I was really worried that I had to start my work again. Thank you again

  32. Enc

    Yes, thanks a lot... Really bad when something like this happens when you´re in a hurry right before a presentation...

  33. rinaldo

    If you have a 2nd partition (HDD) on your VW you might also have a .lck file loccated there. In this instance you will need to delete the .lck file in both locations

  34. bike clothing

    After studying a couple of of the weblog posts on your website now, and I actually like your approach of blogging. I bookmarked it to my bookmark web site record and will be checking back soon. Pls try my website online as properly and let me know what you think.

  35. Dorothy Odell

    This saved me from having to redo alot of projects I had for my Server classes!! Thanks so much!!

  36. funeral homes in lancaster pa

    When I originally commented I clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the same comment. Is there any approach you'll be able to take away me from that service? Thanks!

  37. Denver Swartz

    Thanks alot man you save my school. My students also thank you for the advice.

  38. storage syracuse ny

    Rarely do I encounter a blog that’s both educated and entertaining, and let me tell you, you might have hit the nail on the head. Your idea is excellent; the difficulty is something that not enough individuals are speaking intelligently about. I am very joyful that I stumbled across this in my search for something relating to this.

  39. Miguel

    Thanks a lot .. This happened to one of my very important VMs .. I really appreciate it !!

  40. sivalakshmi

    its worked, but wt the reason of dis error, and after deleted , how it works????

  41. hhack descargar gratis

    Gymnast Li Ning, founded by the same name sports shoes and apparel manufacturing regailer headquartered in Beijing,
    in 2002 to 2009, revenues increased by 9 times eaarnings
    per share increased 10-fold. POU MONEY HACK A detailed
    look at their work will help you iin getting what you're looking
    for. Since 1970 Multi-Pure International has been an industry leader.

  42. Addict Him To You Pdf

    The problem was, she expects the man to do all of the
    chivalrous things” like paying for every thing.
    However nonetheless, knowing what I do know now, if I needed to do it over again,
    I would still get into a relationship with her. My level is, awesome intercourse is something that
    one can offer to a relationship, so why maintain it
    again. Moxie raises a great level, notably if the man has
    some dating experience. Few males are going to leap via hoops for a girl they simply met, especially if it was on-line, except
    they are getting one thing bodily in return.

  43. news.joomlaseo.org

    So where ever you see this news you will get the most up-to-date
    news as you also will be able to start to see the track of your
    state and other details if you need to see. Peneff's office with 2 minutes to spare, and hearing him compliment me for my true grit and street smarts with
    1 minute to spare..

3 mentions