分类:
2010-08-11 10:09:27
Seeing as how I was not using the VM (…at least to the best of my knowledge), I clicked on “Take Ownership”, and got an error message that said “Taking ownership of this virtual machine failed”:
What to do? I started googling for the error messages to see if I could find a resource or VMWare support document that described how to troubleshoot them, but to my surprise it took me awhile and some digging to find something. Luckily, which in essence recommended removing VMWare’s lock files on the virtual machine.
This solution worked perfectly for me, so I wanted to document in a little more detail how I implemented it on my Mac.
PLEASE NOTE! This involves using the Terminal and Unix shell commands, so if you are not familiar with either, you should proceed at your own risk. I do not believe anything below is all that complicated for someone with general Terminal / Unix experience, but for example if you are asking yourself right now what the Terminal is or have never dropped into the Terminal before, these directions will not be detailed enough for you.
1. Quit VMWare Fusion.
Before you start, make sure that you have totally quit VMWare Fusion, and it is not running in the background.
2. Launch Terminal.
I decided to go into Terminal to remove the lock files given the Finder does not show hidden files and folders by default. (You could theoretically do all of this in the Finder if you but for me it was easier to just go straight to Terminal).
3. Change to the Virtual Machine directory.
By default, VMWare creates a directory under your user Documents folder called “Virtual Machines.localized” with subfolders for each VM.
On your Mac this directory name will likely be different than mine (it is based on the name of your actual VM). However as an example, on my Mac the directory is:
Therefore, the command to change into that directory (from the default terminal prompt which starts you in your home directory, i.e. /Users/kenclark) is:
4. Verify there are lock files in this directory.
Once you are in the VM’s directory, you should see a number of lock files intermixed with the VM files. To do this, just enter the following Unix command to list the directory contents:
As an example, on my Mac I saw four lock files in addition to VMWare’s system files. They were:
5. Create a directory to back up the lock files.
Theoretically you could simply delete the lock files, but I am more conservative and did not want to risk really messing anything up on my Mac. I created a temp directory for the lock files rather than deleting them.
Here’s the command to make a backup directory I am calling “lockfiles-temp”. (Please note I am assuming you are in the Virtual Machine directory when you do this).
6. Move the lock files into the temp directory.
Again I moved the lock files rather than deleting them to ensure I could rollback if this did not work. Here is the command:
At this point you should verify the move was successful, by executing another directory listing:
When you do this, you should see no lock files in the VM directory.
7. Launch VMWare and Start your Virtual Machine.
Now, power up VMWare and you should see a new screen that shows your virtual machine is unlocked and either “Powered Off” (as mine shows below) or “Suspended” – in either case it will be ready to start up.
Mission Accomplished!