1 Reply Latest reply on Sep 24, 2007 9:06 AM by oreeh

    Corrupt .vmx file after system lock-up.  How to restore properly?

    telackey Enthusiast

      I recently locked up my system by starting VPC 2007 at the same time as VMWare was running.  I did this all the time on my old system, and didn't realize at first that it is a "no-no" with VT support enabled.

       

      Anyway, I had a couple of VMs open in Workstation 6.0, and the one in question ended up with a .vmx file full of gibberish.  I had a copy of the .vmx file, but it is previous to a couple of snapshots I have made.  My goal is to be able to boot the machine without losing any data or corrupting the snapshots.  I am not concerned with keeping the MAC address (which I think I can pick out from the vmware-x.log files anyway), or other things like that, though it would be nice.

       

      Right now, after a first stab I get:

       

      Unable to open file "C:\Virtual Machines\FreeBSD 6.2\FreeBSD6.2.vmdk": One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot.

       

      Now, looking at that I think it is using the wrong .vmdk anyway.  I have:

       

      FreeBSD6.2-000001.vmdk

      FreeBSD6.2-000002.vmdk

      FreeBSD6.2.vmdk

       

      I think the it should point to one of the numbered disks, but, is it guaranteed that it just needs to point to the last one?  I've made a copy of the whole directory, so I'll try a few things with relative safety myself, but any help is appreciated.

       

      This is a good hint to back-up my .vmx files more regularly...

       

      =============  Update ============= 

       

      Nevermind, I figured it out.  I can see the whole thing in the VMWare log under the --- CONFIGURATION line.  I just copied the log output, and then in vim to reformat it:

       

      %s/^.*DICT //g

      %s/^\s*//g

      %s/ = \(.*\)$/ = "\1"/g

       

      And that was it, away I go.  I figured I'd go ahead and post this even though I've already got it working, in case someone else runs into the same thing.