THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

John Paul Cook

Migrating a virtual machine from Virtual PC to Hyper-V and back

This post is a companion to my webcast on migrating virtual machines from Virtual PC 2007 or Virtual Server 2005 to Hyper-V and vice-versa. (NOTE: The video is small in size and lacking resolution. I had to view the recording at 400% magnification.) Windows 7 Virtual PC is a different product and not tested or addressed in this post. Migrating to Hyper-V is officially supported by Microsoft. Migrating from Hyper-V is not, which is why this blog post is needed. There are two stumbling blocks to a completely successful migration:

1. Virtual Machine Additions and Integration Services must be removed fist.

2. Virtual PC / Virtual Server and Hyper-V have different HALs. Virtual PC and Virtual Server install an Advanced Configuration and Power Interface HAL. Hyper-V installs an ACPI HAL. They’re not the same. They aren’t fully and painlessly compatible.

image

Virtual PC HAL on the left (look under Computer) and Hyper-V HAL on the right. Virtual Machine Additions are installed in the Virtual PC vm and Integration Services are installed in the Hyper-V vm. Only one logical processor is allocated in Hyper-V.

image

Same Hyper-V virtual machine after changing the number of logical processors from 1 to 4.

Migrating from one virtualization platform to another is a simple procedure requiring a few simple steps and a few reboots. The entire procedures for migrating from Virtual PC to Hyper-V and from Hyper-V to Virtual PC are demonstrated in my webcast. Outlines are published here.

Virtual PC / Virtual Server to Hyper-V Migration

1. In Virtual PC or Virtual Server, remove the Virtual Machine Additions if they are installed and commit the changes.
2. Copy the vhd to the Hyper-V server.
3. Create a new Hyper-V virtual machine using an existing vhd, the one copied from VPC or Virtual Server.
4. Boot the Hyper-V vm and login to it.
5. When you see New Hardware Found prompts, click Cancel on all of them.
6. For Vista and Windows Server 2008 (this does not apply to Windows Server 2008 R2) only, go to Run and start msconfig. Click the Boot tab and then the Advanced options the button. Click the Detect HAL checkbox. Click OK and OK to commit the changes. It will tell you to reboot, but don’t do that, proceed to the next step.

image
Detect HAL exists only on Vista and Windows Server 2008.

7. If your operating system is supported by Integration Services, install them.
8. Reboot.

NOTES:

1. If you are prompted to provide the installation media for the virtual machine’s operating system, do so as many times as you see the prompt. Use an iso file instead of physical media if you have an iso. Not only is an iso faster than physical media, you don’t have to have access to the physical server.

2. It is very important to understand that by default, you have a single emulated optical device accommodating only one optical media source at a time. If you replace the Integration Services iso file with the operating system media, you break the chain of the Integration Services installation process. Depending on your specific circumstances, you’ll either be prompted to reinsert the Integration Services iso file or the installation of Integration Services may not successfully complete. The point is that you keep trying to Install Integration Services until you see the dialog box that the install was successful. You might be able to prevent this mess by adding another virtual optical drive before booting the virtual machine. You could use the second device for the operating system media, leaving the default optical device dedicated to the Integration Services installation. All of this sounds much worse than it really is. I just use the default configuration and provide the correct media when prompted, if at all.

What if you forget to remove the Virtual Machine Additions?

Sometimes people forget to remove the Virtual Machine Additions first. Over the years, different versions of the Virtual Machine Additions have been released. The newer versions can be uninstalled from within a running Hyper-V machine. The older ones cannot. So, try to remove them if you can. If they uninstall, continue with the migration process. If they don’t uninstall, you’ll have to go back to Virtual PC or Virtual Server and remove them before proceeding.

image

Hyper-V to Virtual PC / Virtual Server Migration

This isn’t as easy. HAL differences keep a Hyper-V vhd from fully booting in Virtual PC or Virtual Server. You have to replace the HAL, but since you can’t really boot the virtual machine. you have to replace the HAL first. You’ll need a Virtual PC or Virtual Server vm with the same operating system. Using the technique I described in my previous post, you copy the HAL from the vhd for the working virtual machine to the vhd you copied from Hyper-V. My webcast shows the entire migration process including replacing the HAL.

1. Merge away or delete any snapshots. You have to reduce your virtual machine to a single vhd. In Hyper-V, uninstall Integration Services if they are installed.
2. Copy the vhd to where you have Virtual PC or Virtual Server installed.
3. Create a new Hyper-V virtual machine using an existing vhd, the one copied from VPC or Virtual Server.
4. Boot the newly created vm and login to it.
5. When you see New Hardware Found prompts, click Cancel on all of them.
6. For Vista and Windows Server 2008 (this does not apply to Windows Server 2008 R2) only, go to Run and start msconfig. Click the Boot tab and then the Advanced options the button. Click the Detect HAL checkbox. Click OK and OK to commit the changes. It will tell you to reboot, but don’t do that, proceed to the next step.
7. If your operating system is supported by Virtual Machine Additions, install them.
8. Reboot.

I’m probably supposed to say something about this type of migration being completely unsupported (and don’t do this at home, it could hurt you, etc.),  which it is. But pragmatic developers do all kinds of things that are unsupported and there’s a need to do this from time to time.

In the webcast, there was a question asked about the number of processors that can be assigned to a virtual machine in Hyper-V. I think I may have misinterpreted the question, so I will provide some details here. Windows XP Pro supports 1 – 2 processors. More specifically, it supports 1 – 2 processors that can be hyperthreaded. Two hyperthreaded processors appear in Task Manager as four processors. This is the means by which four logical processors can be assigned to an XP virtual machine. There aren’t any single core processors that can run Hyper-V, so it’s not possible to create a situation where an XP  virtual machine’s four logical processors come from more than two physical processors. Nothing about assigning four logical processors is exceeding the capabilities of XP – that’s the explanation I was seeking to provide, although in hindsight I’m not sure that was actually the question being asked.

Published Saturday, August 29, 2009 6:29 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Kevin Kline said:

I just posted a new entry on my SQLMag Tool Time blog that you might enjoy. Thanks to my friend and fellow

October 9, 2009 1:08 PM
 

Gavin said:

This does not work with my Windows 2003 Standard SP2 VM.

It exists in Hyper-V 1.0 and will not move to Win7 Virtual PC.

1. Removed Hyper-V Guest Components.

2. Created a new vanilla Win 2003 Standard SP2 VM in Virtual PC.

3. Attached VHDs to Win7, copied over the HAL.dll file.

4. Boot the VM in Virtual PC.

The VM gets past the black screen, and allows login, but always crashes or hangs, sometimes even hanging the host machine.

The above steps are from your webcast.  They are not the steps listed above for this procedure, which don't tally with the webcast.  In particular, step 3 seems wrong.

At this point after multiple attempts, my time limit for this is shot and I wish I'd just rebuilt the machine from scratch on Virtual PC, but if you have any insight it would be helpful.

June 2, 2010 11:20 AM
 

John Paul Cook said:

The webcast and the blog post are from August 2009, which is before Windows 7 Virtual PC was released. Virtual PC in the webcast and this blog post refers to Virtual PC 2007. Windows 7 Virtual PC is a different product. I have not attempted migration between Windows 7 Virtual PC and Hyper-V. Nor have I tested migrations with Virtual PC 2004. Additionally, I do not have a Hyper-V version 1.0 server, only Hyper-V R2.

June 2, 2010 12:21 PM
 

Gavin said:

It may be worth stating those versions at the top of your article, as this was not clear and others may also be wasting their time.  Windows 7 Virtual PC was in Beta at the time, I understand.

It's a shame that you have not kept your article current, as I'm sure there would be interest.

Looking over the situation, it's sad that new versions have come around and the problem has not been addressed by Microsoft.  They clearly do not see any need for a method to port VMs between their two virtualisation products.  Not a very pragmatic standpoint, and the sort of thing which will make people take a closer look at competing products.  In fact, right now I'm off to see whether I can solve this problem with a VMWare product.

June 2, 2010 12:46 PM
 

Gavin said:

Shockingly easy with VMware's free products.

1. Install VMware Converter on the Hyper-V host.

2. Run the conversion wizard as if it was a physical machine (only took 10 minutes to re-virtualise).

3. Install VMplayer on the laptop/desktop.

4. Copy the generated files across and start the new VM.

5. Uninstall Hyper-V Guest Components.

6. Install VMTools.

No hitches, all very slick.

As somebody who is qualified in Microsoft Virtualisation products, this displeases me!

June 3, 2010 12:10 PM
 

Lingnau said:

I´ve exchanged a Hyper-V working Windows XP Virtual machine´s hall.dll with the hall.dll from a Virtual Windows Virtual Machine Running windows XP. It now gets past the black screen but hangs on the loading screen.

November 22, 2010 11:15 AM
 

John Paul Cook said:

As I mentioned, this is completely unsupported. Sometimes it doesn't work. I am unable to provide you an answer that will definitely fix your problem.

November 23, 2010 9:16 PM

Leave a Comment

(required) 
(required) 
Submit

About John Paul Cook

John Paul Cook is both a Registered Nurse and a Microsoft SQL Server MVP experienced in Microsoft SQL Server and Oracle database application design, development, and implementation. He has spoken at many conferences including Microsoft TechEd and the SQL PASS Summit. He has worked in oil and gas, financial, manufacturing, and healthcare industries. Experienced in systems integration and workflow analysis, John is passionate about combining his IT experience with his nursing background to solve difficult problems in healthcare. He sees opportunities in using business intelligence and Big Data to satisfy healthcare meaningful use requirements and improve patient outcomes. John graduated from Vanderbilt University with a Master of Science in Nursing Informatics and is an active member of the Sigma Theta Tau nursing honor society. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2.

This Blog

Syndication

Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement