Friday, August 12, 2011

VMWare Fusion Lock Files

Here's a neat one.

I used to work off a Macbook provided by my previous employer, complete with VMWare Fusion for running Windows VMs. When I left I backed up my computer with Time Machine. A year later I was able to get a new Mac (finally; they're darn expensive!) and I restored my old backup to it so that I could have all of my original settings. It worked like a charm, except I couldn't actually launch my saved Windows 7 VM. I tried building a new one using the old files with no success.

I finally figured out what the issue was. I didn't realize that when you suspended a VM, the host puts a lock on the files so that it can't be used by another disk at the same time. When I did my backup, the VM was suspended, not shut down, so there was a lock on it. Therefore every time I tried to spin it up on the new machine it thought the VM was already in use. All I needed to do was find the .lck file and delete it.

The next step was finding the lock file. On a Mac (not sure about Windows), the virtual machines are stored in your Documents under a folder called Virtual Machines, and each vm is a single file. I tried using spotlight to search for .lck files with no luck. I knew these files existed because when trying to import I was able to point to a .vmdk file. A thoughtless right-click brought up an option to "Show Package Contents", and there they were! I deleted the .lck file, and my vm powered up with no problem. I love it when a plan comes together.

1 comment:

  1. Thanks. I ran across lots of stories and blog posts that noted removing the lock file would resolve the issue. But this was the only post that helped me figure out how ti find the lock file on a mac.

    ReplyDelete