Converting your old System to a Virtual Machine
using VirtualPC 2007
Why not just upgrade or repave the system?
A few months before I wrote this article, I went through the process of upgrading my workstation hardware, which came with a new installation of Windows XP PRO. I could have just transfered the contents of my old hard drive to the new one and manually fix the hardware drivers differences later. Or I could just transfer my documents to the new system, install all the applications I need and kiss the old system goodbye.
As much as my old system (hardware and Windows XP installation) were in need of a cleanup, there were a huge number of things that I had to install on this system that took some time to find the correct version and configure tjust the right way. Nothing that I couldn't do all over again, but I know some of these utilities, drivers, or applications require a lot of effort to find the appropriate documentation or tutorial.
Add to that the desire to leave some of these same applications behind and replace them by new versions or even different products altogether. The problem is that there is always the chance that I'll need that precise older version when things don't work as expected in the new system.
Instead of keeping two physical boxes humming under my desk, I decided to try and transform the older system in a virtual machine running off an external hard disk or directly from the new system's hard drive, which as usual has much more space than the old one.
The plan
Here's what I had in mind: I would log on to the old system, create an image of the hard drive, go to the new system, create a new virtual machine, restore the old machine hard disk over the virtual machine's disk.
Sounds simple enough, right? Well, it is simple but there are a lot of details along the way that might make someone less stubborn to give up. I tried to capture as many of these details as I could in this article.
Scenario
- I did not have a second HD on the new box and the old HD could not be used in the new box (sata vs. pata)
- I wanted to move the old machine to a VM on an external HD (FAT 32)
Software used
- VirtualPC 2007
- Ultimate Boot CD for Windows (http://www.ubcd4win.com/) a.k.a UBCD4WIN
- DriveImage XML (DiX) http://www.runtime.org/dixml.htm also included in UBCD4WIN
Although I made the above free software choices, the concepts are the same if you chose other tools that you happen to be more familiar with, like VMWare or Norton Ghost.
Back up the old system
- On the old physical box
- Uninstall every thing you don't think you'll ever need in the old box again
- Make sure you moved all you documents and data to the new physical box
- In general, remove anything that takes up unnecessary disk space
- Make sure the critical applications still work (things that are making you not get rid of this box for good, like VS 2003, VB 6, etc)
- Check the disk usage and make a not of how much disk space you're using now. Let's say it's 35GB as an example.
- Attach the exernal HD
- Download DiX and installed it
- Run DiX and choose Backup
- Choose where to save the backup image file (in this scenario we will choose somewhere in the external HD)
- Choose a name for the image of the drive being backed-up, like "OLD_C"
- Don't forget to check "Split large files" otherwise the external drive will choke on backups larger than 4GB
- Click Next and the process will start. It may take a couple of hours. Leave it alone until it finishes
- When it's done, the backup will be found in the chosen external directory, in chunks of ~600MB or so.
- Give you machine one last hug and promise her you'll meet again in the virtualized world
- Power it off
Create a new virtual machine
- On the new physical box
- attach the exernal HD
- Download and install VirtualPC 2007 from Microsoft
- Create a new virtual machine named after the old box, like "Old PC Feb 2008", located in a directory of the external HD, like G:\Virtual Machines\OldPCFeb2008\
- Choose "Windows XP" as the OS
- Choose to create a new virtual hd, use the default name but choose a size that accommodates the old machine disk, in our case it would be 35GB, we'll choose 40GB to give it some space to breathe.
- When you finish, the new VM will be available in the Virtual PC console.
- Create a temporary Windows XP installation on the new VM
- Get a Windows XP Pro SP2 installation CD or the CD .ISO file (you can download one from MSDN if you happen to be a subscriber)
- Start the new VM and attach the CD or ISO file
- Make sure you boot from the CD/ISO to start XP's intallation
- Install XP as usual
- In you new VM, in the temporary XP installation
- Install Virtual Machine Additions (look in the Action menu)
- Shut down the VM (really shut down, do not save state, use Start -> shut down)
- In the VirtualPC console, choose the new VM and click Settings
- Choose Hard Disk 2, and click the Virtual Disk Wizard button
- Create a temporary virtual HD in the same directory as the VM's HD. Name it "Tempdisk.vhd". Choose Fixed Size. Choose a size that can fit all the backup files created with DiX.
- Back in the settings window, choose the new HD using the Browse button.
- Click OK to close the Settings window
- Start the VM again
- after Windows comes up again, go to Computer Management --> Disk Management
- You'll see the new temporary HD there, unformatted. Make sure you format it and assign a drive letter to it.
- (you may have to reboot the VM after that... I don't remember now)
- Once you have the new drvie letter available, open it in an Explorer window and maximize this explorer window.
- Go back to you host Windows (new physical box) and open the directory with the files created by DiX (external HD) in an Explorer windows too
- Drag all these files from the Host to the VM explorer window... They will all be copied to the temporary virtual HD
- The job of this temporary windows VM is done.
Restore the old system
- Attach the UBCD4WIN CD/ISO to the VM and boot from the CD
- After UBCD4WIN starts, look for DriveImage XML in the disk utilities
- Use DiX to restore the old PC from the second HD (the temporary HD) into the first HD (where the temporary Windows is at the moment)
- Let it restore. It will take a while.
- When it's done you should be able to boot into the old Windows
- You will need to re-activate windows because of the hardware changes (all new virtual hardware)
- Make sure your networking is functioning (in the VM settings, choose Shared Networking (NAT) )
- You should be able to activate via the internet now. If the activation process complains that the hardware changed too much or something like that, yo may have to call Microsoft to get a new activation code (choose activate by phone)
- Go to Disk Management again and dettach the second HD, the temporary one
- Shut down the VM
- In Settings, remove the second HD
- You can now delete the temporary HD. Delete all Tempdisk*.* files
You're done
Did you find anything wrong in the article? Please and I'll try to fix it as soon as possible.