Via Vmdk2Vhd

Dec 16, 2006 10:42 GMT  ·  By

Today on Tweak Mode I will show you a way to convert VMWare file formats to VHD. The file conversion does not actually require a tweak, as it is based on a tool, but I will deliver a guide to the process.

First off, this involves a bit of a download. Namely the Vmdk2Vhd 1.0.7 tool. Not to worry, it is just a 48 KB archive containing three files, and is available right here on Softpedia. "Vmdk2Vhd is a simple utility to convert virtual hard drive images from VMWare's VMDK format into the Microsoft's VHD format. This is a sector by sector copy operation from one format to the other and the source file remains unaltered. Vmdk2Vhd requires the Microsoft .Net 2.0 framework," reads the product description posted on vmToolkit.

The first step to converting VMware virtual hard disks (VMDK) into Microsoft VHDs is to prepare the source VM. Here is the script that will allow you to do so, courtesy of Chris Wolf over at SearchServerVirtualization.

'prepvm.vbs 'Removes VMware-specific drivers from a system On Error Resume Next ' Instantiate Shell Object Set objShell = CreateObject("WScript.Shell") ' Disable VMware Tools Service objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesVMToolsStart", _ 4, "REG_DWORD" ' Disable VMware vmx_svga video driver objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesvmx_svgaStart", _ 4, "REG_DWORD" ' Disable VMware vmmouse driver objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesvmmouseStart", _ 4, "REG_DWORD" ' Disable VMware vmscsi driver objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesvmscsiStart", _ 4, "REG_DWORD" ' Disable VMware PCnet driver objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesPCnetStart", _ 4, "REG_DWORD" ' Disable VMware Buslogic driver objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesbuslogicStart", _ 4, "REG_DWORD" ' Disable SCSI Miniport drivers objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicessymc810Start", _ 4, "REG_DWORD" objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicessymc8xxStart", _ 4, "REG_DWORD" objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicescpqarrayStart", _ 4, "REG_DWORD" objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicespcntn4mStart", _ 4, "REG_DWORD" objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicescpqnf3Start", _ 4, "REG_DWORD" objShell.RegWrite "HKLMSYSTEMCurrentControlSetServicesMRaidNTStart", _ 4, "REG_DWORD" ' Restart Computer strComputer = "." 'Prompt user of impending reboot WScript.Echo("The system is prepared for imaging and will now shutdown.") WScript.Sleep(3) Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate,(Shutdown)}!" & _ strComputer & "rootcimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems objOperatingSystem.Shutdown() Next

To continue" - Use VMDK2VHD to convert the VMDK virtual disk to to a VHD - Create a new VMC with roughly the same hardware (IDE drives, etc, etc) in Virtual PC 2007 - Attach your newly created and converted VHD - Power up you new VMC, login and wait (a few minutes) for *all* the new hardware to be detected - I clicked cancel to the new hardware driver wizard - I also clicked "No" to the reboot - hey livin' on the edge here - Install the Virtual Machine additions - Reboot

And that's about it. A big thanks goes out to Andrew Dugdell over at Dugie's Pensive for making this available.