I'm using Ubuntu 12.10 as my main machine. Taking an image of a Windows XP Home Media edition with an 80G hard drive.
The disk2vhd approach
disk2vhd didn't turn up as one of the many options that were presented as I started down this path, but it ended up being the easiest and quickest of those I tried. I followed these instructions to create the vhd. Then I used VirtualBox to open the image. The only thing I had to modify in VirtualBox was this: in System -> Motherboard check the Enable IO APIC box in the Extended Features setting.The Clonezilla approach
I had space on my system's hard drive that is sufficient but not any flash drives so I backed up using Clonezilla's ssh option to my main box. This was convenient since I'd be creating the image of the system on the main box anyway.Before you reference the steps below, understand that I was only able to get to the point where the vm could boot to the safe mode prompt screen, but then hung on any attempt to move forward. I've got a hunch that trying this with cloning a Linux box would have gone better.
There are several distinct units of work:
- prep the source machine
- create media
- prepare a repository location for the backup
- create the clone
- create a VM from the clone
Prep the source machine
Issues with the source machine
I loaded Clonezilla on a USB drive and ran fine for two partitions (boot and D:/), but not for the main partition where the OS files were installed. After experiencing issues with booting SpinRite6 from a USB drive that cleared up when using a DVD, I burned the Clonezilla ISO to a physical DVD.I then decided to try and make the source image as 'clean' as possible by doing the following:
- Removing unused files/dirs manually, running disk clean and emptying the recycle bin on the source machine
- Defragging the source machine
- Updating BIOS to the latest version provided for my source machine by the manufacturer
- Running SpinRite on the source machine
Create media
Create Clonezilla disk
Create bootable Clonezilla ISO using Tuxboot.
For me the repository location is an Ubuntu 12.10 machine. It has more space than any external drives I have and it is where I'll be creating and hosting the VM.Create Windows boot disk
I relied upon http://support.microsoft.com/kb/305595 for instructions. My machine didn't come with any physical media so I needed to harvest the files from C:\. ntldr and ntdetect.com were in C:/WINDOWS/ServicePackFiles/i386. boot.ini.backup was in C:\Windows\pss which was good since I used it to confirm the boot.ini name of my operating system.
Tried boot-repair first since screen was blank when I restarted. After boot-repair I got Windows boot screen, but it just hung part way through the process no matter which option.
Prepare a repository location for the backup
- Install/confirm openssh
- Create directory /home/partimag on the destination machine and give said directory the appropriate permissions
Create the clone
- Boot source machine with Clonezilla media
- When prompted, enter connect info for your destination box
- Give yourself a few hours if you have an old 80G box you're attempting to clone :)
Create a VM from the clone
- Create a vm with the same amount (or more) of space
- Start the vm with the Clonezilla ISO. Follow the prompts and select restoredisk