Utility Spotlight VMC to Hyper-V Import Tool

Matthijs Ten Seldam

Code download available at: TenSeldamUtility2009_03.exe(815 KB)

Contents

VMC to Hyper-V Import Tool
The Scope of VMC2HV
Out of Scope
What about SCVMM?
What VMC2HV Does
Requirements
Future Version

With the release of Hyper-V in Windows Server 2008 and the recent release of Hyper-V Server 2008, people are starting to use Hyper-V for their test, development, and production environments. Creating virtual machines (VMs) with Hyper-V is very easy, and installing operating systems and applications in a virtual machine is as transparent as in the physical world. Many people, however, have existing VMs that were used with Virtual PC 2007 or Virtual Server 2005 R2 SP1.

Fortunately, these older VMs can be used with Hyper-V as well. But before that can occur, you must perform certain manual steps. At the very least, you need to attach the virtual hard disk (.vhd) files to the hard disk drives in Hyper-V. This requires creating a VM using the Hyper-V wizard, opening up the settings for the newly created VM, and then configuring the drives (probably IDE) with the virtual hard disk files.

fig01.gif

Figure 1 VMC2HV lets you adjust almost any setting before creating the VM in Hyper-V

Within Hyper-V, you must uninstall the Virtual Machine Additions and install the Hyper-V Integration Services. When this is done, you have migrated the original VM to a Hyper-V VM.

But there are many other settings you may want from the original VM, such as those related to memory, CPU resource control, DVD image, floppy image, and SCSI controllers. Those settings are not stored in the VHD file but in the Virtual Machine Config (VMC) file.

If you want to include those settings in your new VM, you must open the VMC file in Notepad for reference and make the adjustments in Hyper-V accordingly—by hand. When you have several VMs, this process takes quite a bit of time.

The fact that Hyper-V lacks VMC import functionality drove me to develop a VMC to Hyper-V import tool. This tool imports the settings from a VMC file and displays all equivalent settings in its UI. From there, you can tweak the settings, update the virtual drive image paths, choose whether to create synthetic or legacy network adapters, and more. Once you are done, you can create the Hyper-V VM from the original VMC configuration with one click.

VMC to Hyper-V Import Tool

So what is the VMC to Hyper-V Import Tool, VMC2HV for short, and for what was it intended? As noted, VMC2HV imports the configuration from a VMC file so that you don't have to configure each Hyper-V VM manually. Both Virtual PC and Virtual Server use VMC files to store the hardware and other properties of a VM. VMC2HV reads the VMC file and maps all relevant properties to those for a Hyper-V VM. For those properties that did not exist in earlier VMs, VMC2HV provides additional options. Those properties that no longer exist are ignored.

The Scope of VMC2HV

The tool was initially developed simply to import Virtual Server VMC files. Virtual Server is a server product, and so is Hyper-V. But I received requests to add support for Virtual PC as well because many of the product-evaluation VMs are created with Virtual PC. So I did some additional testing with Virtual PC 2007 VMC files. The testing was not too extensive, but I did modify the code in several places to accommodate the differences between Virtual PC and Virtual Server.

I did not specifically test Virtual PC 2004 VMC files. I imported several and that worked, but I didn't actually test those VMC files since the product was superseded long ago. The same is essentially true for Virtual Server 2005 R2 SP1. I only tested VMC files under the latest release of Virtual Server 2005.

Out of Scope

The tool imports a VM configuration. This means it imports the hardware settings of the VM, but it does not modify the contents of the virtual hard disk(s). As noted, you must manually remove the Virtual Machine Additions and install the Integration Services. If you want automatic removal of Additions and installation of Integration Services, use System Center Virtual Machine Manager (SCVMM) 2008.

What about SCVMM?

VMC2HV was not developed to replace SCVMM functionality. SCVMM is the product you should use to import, create, and manage virtual machines in an enterprise environment.

SCVMM can import VMC files and provides additional management functionality. VMC2HV does the same but is intended for people who do not (yet) have SCVMM, such as those that are using Hyper-V on laptops or on only a couple of servers. Using SCVMM simply for importing VMC files is probably overkill.

What VMC2HV Does

So what does VMC2HV have to offer? The following is a summary of the tool's capabilities:

  • Import of both Virtual Server 2005 and Virtual PC 2007 VMC files
  • Creation of a VM on local Hyper-V host
  • Creation of a VM on remote Hyper-V host
  • Validation of virtual disk and ISO files in local scenario
  • Editing of virtual drive image paths (vhd, vfd, iso)
  • Swapping of the first SCSI disk with the first IDE disk
  • Specifying of static MAC addresses
  • Specification of either legacy (emulated) or enhanced network adapter
  • Specifying of the number of virtual processors and resource controls
  • Specification of management settings
  • Specification of COM ports
  • Specification of device boot order
  • Specification of alternate virtual machine path
  • Built-in help in a CHM file
  • Support for both x86 and x64 Windows Vista and Windows Server 2008

As you can see from the screenshot, VMC2HV not only imports the VM configuration, it also lets you adjust almost any setting before creating the VM in Hyper-V. Several shortcut keys have been included to help speed the process if all you want to do is import and create several VMC files.

Requirements

You can import VMC files from any file location, and you can then create the VM either locally or remotely. In the remote scenario, both the client where VMC2HV runs and the remote Hyper-V host must be in the same domain. Or alternatively, both client and remote Hyper-V host can exist in a workgroup, but you need to use mirrored administrator accounts (the same administrator using the same password). Other configurations simply do not work.

The tool prevents the importing of VMC files that contain either saved state information or Undo disks. VMs must be in Shut Down state, and Undo disks must be committed or discarded.

Chances are you're going to want to migrate your older VMs to Hyper-V, and if you don't yet have SCVMM, moving all the settings you need can be a chore. VMC2HV makes the process much easier.

Future Version

A new version of VMC2HV is under development, and it will incorporate several changes and improvements. Perhaps the most notable change is the use of a tabbed interface. This new interface was necessary to be able to provide more efficient access to additional properties that would otherwise require a larger window.

The new release will support all Hyper-V VM properties, including a number of new management properties such as Snapshot file location and Integration Services. Integration Services includes options for Operating system shut down and Time synchronization.

Networking will support the selection of already existing Hyper-V Virtual Networks, making it possible to attach network adapters to virtual networks prior to creating the VM. Finally, the new release will support Hyper-V v2, which is part of Windows Server 2008 R2.

Matthijs ten Seldam is Partner Technology Specialist at Microsoft for infrastructure products. He is focused in the areas of security, deployment, and automation. He is a subject-matter expert in the area of virtualization.