Virtual machines – convert XP Physical to Virtual – P2V


HAL
The hardware dependent portion of the Windows kernel is dubbed “Hardware Abstraction Layer” (HAL). While hardware vendor specific HALs have become very rare, there are still a number of HALs shipped by Microsoft. Here are the most common HALs (for more information, refer to this article: http://support.microsoft.com/kb/309283):

Hal.dll (Standard PC)
Halacpi.dll (ACPI HAL)
Halaacpi.dll (ACPI HAL with IO APIC)
If you perform a Windows installation with default settings in VirtualBox, Halacpi.dll will be chosen as VirtualBox enables ACPI by default but disables the IO APIC by default. A standard installation on a modern physical PC or VMware will usually result in Halaacpi.dll being chosen as most systems nowadays have an IO APIC and VMware chose to virtualize it by default (VirtualBox disables the IO APIC because it is more expensive to virtualize than a standard PIC).
So as a first step, you either have to enable IO APIC support in VirtualBox or replace the HAL. Replacing the HAL can be done by booting the VM from the Windows CD and performing a repair installation.

Enabling APIC in virtualbox seems to make XP really slow, so I leave it off and do the XP repair, full guide here:-

http://www.geekstogo.com/forum/topic/138-how-to-repair-windows-xp/

Hard Disk Support
For reasons we don’t understand, Windows memorizes which IDE/ATA controller it was installed on and fails to boot in case the controller changes. This is very annoying because you will run into this problem with basically all migrated images. The solution here is to perform several modifications to the Windows registry. This can be done while the installation is still running on the original system because all it does is relax the IDE checks. Therefore the installation will continue to work on the original system after the modification. The easiest way is to use the excellent MergeIDE utility from the German c’t computer magazine. Alternatively, instructions in Microsoft’s knowledge base article can be followed: http://support.microsoft.com/kb/314082

If you are converting an XP machine, you must do mergeide first, before running the converter.

Use the free VMware converter to convert a live OS running on real hardware into a virtual machine (.vmdk file)
Get it here:-
http://www.vmware.com/products/converter/

for output, select othervm, and version6, full guide here:-

http://www.pjsquared.com/blog/?p=169

Virtualbox can run .vmdk files, no need to do a conversion

After starting virtualbox, make a new vm, and when adding a disk, point to the vmdk file made with vmware converter earlier.

To clone a vm and move it to another machine, guide is here:-

http://www.techrepublic.com/blog/itdojo/clone-and-move-virtual-machines-in-virtualbox/3305

If needed, How To: Convert VirtualPC .vhd hard drives to VirtualBox .vdi hard drives (or vice-versa)

Don’t bother – VirtualBox now natively supports .vhd drives

But if you really wanted to, just use:

 VBoxManage clonehd source.vhd target.vdi --format vdi

This will place the .vdi version of your drive in your current users VirtualBox folder, which is:~/.VirtualBox

Relatedly, to go the other way (.vdi to .vhd) you could use:

 VBoxManage clonehd source.vdi target.vhd --format vhd

Note: For this to work, you must not have the drive attached to any virtual machine, so if you already have it connected to a virtual machine, detach it first.

Advertisements
This entry was posted in Virtualisation. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s