Migrate XP or other Windows OS’s to VirtualBox

 




I needed to migrate a Windows XP box because it has a special piece of software…what special piece of software you ask?  A real museum piece!  Lotus 1-2-3 with a special quote form I didn’t have time to migrate into something more contemporary.

I ran into lots of issues, here’s how I worked past those issues and made it happen:
* Fair warning here, you MAY have to re-register Windows when it boots up (I had to for XP but it worked to do so)

First:  Read the how to from VirtualBox:  https://www.virtualbox.org/wiki/Migrate_Windows

* After renaming the agp440.sys and the intelppm.sys then running the MergeIDE bat file image the machine per their instructions

1 – Make an image of the current physical box with clonezilla. It will bust it up into different size files, the default is 2000 megabytes (2 gig chunks).  I’d make it much larger, if you have an 80 gig drive make it 85000 (85 gig just to be safe).  I didn’t happen to do that but I think it’s an arbitrary thing ultimately since when you read the image back into the disk clonezilla automatically does it’s thing regardless of chunk size.

2 – Create a new XP virtual machine in VirtualBox (can’t hold your hand on this one…it would take too long to tell you how to do that so I assume you’re not a total derp and you can manage this step).

3 – Select the new XP image > settings > storage > select the CD drive (Empty) > Click the drop down to the far right of “Optical Drive” and select your clonezilla ISO (I assume you have this in a folder on the new machine running VirtualBox).

4 – Boot the machine and image your saved image back to the virtual drive.  Once done shut the machine down.

5 – Here’s where I ran into a lot of problems on boot up:

Virtual Box boots up and it’s just a black screen.  For this you need to be quick on the draw and hit F8 repeatedly to bring up the safe mode prompt.  Then boot into safe mode, you should see either more black screen OR files flying accross the screen.
If you also see the lines at the bottom just haning there and doing nothing this is also the fix for this problem:

I found that in c:\windows\inf\ <– that folder on my imaged machine was EMPTY!  Copy the data from your old physical box into your new one.  I had to rename the INF folder to INF.kill > make a new INF folder then dump my files in there.  You might also want to delete any “oem” inf files, in Linux you can do a:  “ls | grep oem” to see the files with oem in their names then “rm -f oem*.inf” to delete all the INF files, note there are “PNF” files still left.  I left those…not sure what they’re for!

Once you do that…more problems but we can fix them.

I got a blue screen that said:  {Registry File Failure}:
Good one!  It says:  \SystemRoot\System32\Config\DEFAULT or its log or alternate.  It is corrupt, absent, or not writable.

All you need to do here on XP is restore the registry backup!  In c:\windows\system32\config there’s a file named “default” and “default.save”.  Rename the “default” to “default.kill” so the system won’t look at it then rename “default.save” to “default”.  The .save file is your registry’s “last known good” ;)
You can also go to your old physical box > boot up a Linux Live disk > migrate to that folder and copy your current “default” file onto removable media (USB disk) > then sneaker net it over to your other box > overwrite the default in the c:\windows\….config folder.

Reboot!  Try safe mode just to be safe.
Success (at least for me).  You then login and you get errors about:  “The file or directory c:\windows\system is corrupt and unreadable. Please run the Chkdsk utility.”.

** Fair warning again – this totally HOSED me when it booted up because when it booted up it didn’t want to run the registration wizard so I re-did the migration knowing what to check (see above notes so far) and it went perfectly the second time…I think the original image back was borked since the INF folder was empty and the registry file was bad.

Computer > right click c: > properties > tools > error checking > check both boxes > start > reboot
Windows will go through a litany of file systems checks and repair the error.  Windows should now come up normally.
After that’s all done > install your guest additions > make sure your drivers area good and things work.  If it mostly works I’d call it a success!

One last thing – you need to delete any OEM inf files in c:\windows\inf folder > you can ignore the *.pnf files.  Delete all the OEM one’s.  When I booted up my Live Linux distro I went to the terminal > cd’d to the directory (wherever yours mounts it) then did a:

ls | grep oem

or you might need to do:  ls | grep OEM

Just to make sure you have all the oem INF files in the list and your syntax is correctly typed THEN you can do:  rm -f oem*.inf <– enter

Done!

Now reboot and let it boot up normally.

This is basically what I did – just do it!  You have the saved image and as long as it imaged correctly you can do this all day ;)