Migrating from physical to virtual with Hyper-V and disk2vhd

I have a PC on which I did most of my work for several years. It runs Windows XP, and although I copied any critical data off it long ago, I still wheel it out from time to time because it has Visual Studio 6 and Delphi 7 projects with various add-ins installed, and it is easier to use the existing PC than to replicate the environment in a virtual machine.

These old machines are a nuisance though; so I thought I’d try migrating it to a virtual machine. There are numerous options for this, but I picked Microsoft Hyper-V because I already run several test servers on this platform with success. Having a VM on a server rather than on the desktop with Virtual PC, Virtual Box or similar means it is always easily available and can be backed up centrally.

The operation began smoothly. I installed the free Sysinternals utility Disk2vhd, which uses shadow copy so that it can create a VHD (virtual hard drive) from the system on which it is running. Next, I moved the VHD to the Hyper-V server and created a new virtual machine set to boot from that drive.

Windows XP started up first time without any blue screen problems, though it did ask to be reactivated.

image

I could not activate yet though, because XP could not find a driver for the network card. The solution was to install the Hyper-V integration services, and here things started to go wrong. Integration services asked to upgrade the HAL (Hardware Abstraction Layer), a key system DLL:

image

However, on restart I got the very same dialog.

Fortunately I was not the first to have this problem. I was prepared for some hassle and had my XP with SP3 CD ready, so I copied and expanded halaacpi.dll from this CD to my system32 folder and amended boot.ini as suggested:

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS=”Disk2vhd Microsoft Windows XP Professional” /FASTDETECT /NOEXECUTE=OPTIN /HAL=halaacpi.dll

I rebooted and now the integration services installed OK. However, if you do this then I suggest your delete the /HAL=halaacpi.dll argument before rebooting again, as with this in place Windows would not start for me.  In fact, you can delete the special Disk2vhd option in boot.ini completely; it is no longer needed.

After that everything was fine – integration worked, the network came to life and I activated Windows – but performance was poor. To be fair, it was not that good in hardware either. Still, I am working on it. I’ve given the Virtual Machine 1.5GB RAM and dual processors. Removing software made obsolete by the migration, things like the SoundMAX and NVIDIA drivers seemed to help quite a bit. It is usable, and will improve as I fine-tune the setup.

Overall, the process was easier than I expected and getting at my old developer setup is now much more convenient.

3 thoughts on “Migrating from physical to virtual with Hyper-V and disk2vhd”

  1. This raises a question:

    Would it have been easier to install Windows XP SP3 from scratch, and migrate your settings and application via the migration tools Microsoft provides, than converting a physical machine to a VM, and then fine-tune it?

  2. @Phillip

    It wouldn’t be easier. It might be better, as in a cleaner and faster result. Microsoft’s tool only transfers data and settings, not applications – presumably to protect software vendors from unauthorised installs.

    Tim

  3. Ah, I see. And rebuilding a system with all the little tools and addins to tools is nuisance enough. Assuming that the installation media still exist.

    And I guess the migration tools don’t migrate applications, because that’d be a) more difficult (drivers, registry settings that are difficult to trace), and b) impractical since, in general, the installation media still exist or are easily acquired and installed via a slipstreamed Windows install image, or via a network share or so.

    Thanks for the answer. 🙂

Comments are closed.