Virtual Windows XP on Debian 7.3

My old laptop was getting very slow (I bought it on 2006), I had a lot of things installed on it, so I decided to convert it to a virtual machine (physical to virtual), while I complete the migration from windows xp to linux (Debian), just in case I need it.

It was no trivial but in the end I was able to do it with VirtualBox 4.3.2, Disk2vhd.exe and reactivating Windows. The receipt given at https://www.virtualbox.org/wiki/Migrate_Windows, didn't work for me, I could not avoid BSOD windows. Everything is on the Internet, I just tell my experience.

1.- VirtualBox installation on Debian 7.3 (host):

I downloaded from:
https://www.virtualbox.org/wiki/Downloads

As root:

apt-get update
apt-get install libqtgui4
apt-get -f install
dpkg -i virtualbox-4.3_4.3.2-90405~Debian~wheezy_amd64.deb
apt-get install dkms

Installing the extensions (in order to make USB 2.0 works):

VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.3.2-90405.vbox-extpack

References:
http://www.techrepublic.com/blog/diy-it-guy/diy-easier-virtual-media-management-with-virtualbox/
http://www.virtualbox.org/manual/ch04.html
https://wiki.debian.org/VirtualBox

2.- Convert physical (Windows XP SP3) to virtual:

2.1.- On the old laptop (Windows XP):

I clean the OS as much as posible, deleting unwanted files. I also make a defragmentation. This is not necessary but it can save disk space.

I make a image of the disk using Disk2vhd.exe. In order to make this, we need this Windows services running:

Microsoft Software Shadow Copy Provider
Volume Shadow Copy

We can verify if they are running properly if next command yield a provider list.

vssadmin list writers

Example of a provider:

Provider name: 'Microsoft Software Shadow Copy provider 1.0'
   Provider type: System
   Provider Id: {b5946137-7b9f-4925-af80-51abd60b20d5}
   Version: 1.0.0.7

If some error appears we can execute VSSrepair.bat to repair the problem.

Afterwards, we can create the image with Disk2vhd.exe. We will get a file, for example mylaptop.vhd

2.2.- On Debian:

- I launch VirtualBox (GUI)
- In File > Preferences > General, I set the path to the folder where I will store my virtual machines; for example /media/MYDATA/virtualmachines
- Make a new virtual machine:

Step 1: Write the name for the virtual machine, select Windows XP and the name of the folder (/media/MYDATA/virtualmachines/mylaptop-winxp).
Step 2: Select RAM.
Step 3: Move mylaptop.vhd file to /media/MYDATA/virtualmachines/mylaptop using OS, not the wizard.
Step 4: Select mylaptop.vhd file as a virtual disk and Finish.

- Once virtual machine is created, go in and turn on System > “Enable IO APIC”, etc.
It can also be useful:
General > Advance > Share clipboard: Bidirectional
General > Advance > Drag and drop: Bidirectional
USB > Enable USB 2.0 controller (EHCI)

- Click on "Start" virtual machine

When Windows XP starts it will ask for activating the copy (I put the key that appear in the laptop).

On the virtual machine window: Devices > Install "Guest additions".

I had to re-install some drivers.

References:
http://www.flyingpenguin.com/?p=5149
http://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
http://www.sysprobs.com/physical-virtual-virtualbox-virtualbox-p2v

Comentarios