Sunday, November 22, 2009

[VPC] Convert a stand-alone VHD for use in VMWare

Ok, I worked out a solution - at least for me.

It turns out that Converter will convert a VHD - you have to trick it.:

Using a random backup VPC that I had (You could download any demo virtual PC from Microsoft to do this, I think), I edited the VMC file manually to add the following under (substitute your own path and VHD file):

1. E:\VPC2007\DpDisk2\DpDisk2.vhd .\DpDisk2.vhd and then save the VMC file.

2. In VMWare Converter, for source type, select Other.

3. For Virtual Machine, browse to your edited VMC file.

4. On Source Data, you have a couple options. You can convert all the drives, or you can convert only selected drives. I had no reason to convert the active system drive; I only wanted to convert my one data drive. You could, of course, convert the entire virtual machine including all drives. I didn't want to spend the time, so I chose the Select volumes option and only selected drive 1. I left the checkboxes for Ignore page file and for Create separate disks cleared. When I click next at this point, I get a warning about having not selected an active system disk but I could continue anyway. You could avoid this warning by converting the whole VPC but if you only want a single stand-alone drive, why wait for the time it takes to convert the system disk?

5. For destination type, make sure you choose Other Virtual Machine.

6. On Name and Location, put in a fake or random name. Remember that this virtual machine will not be used - it will be useless. We only want the drive that gets created with the machine. You will have to browse to an appropriate location for storing the good VMDK along with the throw-away VMX files.

7. Select the Virtual Machine Options that you want. Unfortunately, this process does not give you the option of selecting the disk type. Even though the source, for me, was an IDE VHD, VMWare Convert converted it as a SCSI drive. They should add an option here to select the interface for the converted drive.

8. Take the defaults on the Networks step. Your VMWare machine won't work anyway so we don't care about the network.

9. Take the defaults on the Customization screen. You don't care about any of these options for this purpose.

10. On the Ready to Complete screen, click Finish.

Here's the output on the Converter window as the process ran:

Step 1 : Connecting to VMware Converter Agent on localhost
Step 2 : Creating target virtual machine and converting data
Configuring parameters for the target virtual machine...
Creating target virtual machine...
Cloning volume...
Updating boot sectors...
Adjusting drive letter mappings...
WARNING: Failed to adjust drive letter mappings
Step 3 : Preparing target virtual machine
ERROR: Unknown error returned by VMware Converter Agent

After about 70% completion, the completion percentage indication immediately jumped to 97% and I got the warning and error messages shown above. I thought my experiment had failed but when I checked the log, I found that the import task succeeded and a later step, DoReconfig, failed. That goes along with the output of the process. The part of the process I needed had succeeded. I added the newly created VMDK to the VM that I needed it in and it worked as expected.

Maybe this will help someone else save some time.

Please refer to: http://communities.vmware.com/thread/188367

No comments:

Post a Comment