Win XP Physical Machine to VHD to Virtual Box

DerekZ06

Member
Feb 19, 2008
36
0
0
My Aunt has a 11 year old DELL machine with hardware issues. I'm trying to convert it to a Virtual Machine that will run in Virtual Box or other free Virtual machine software. I also want the VHD to be easily mountable.

Because of RAM related issues, Windows XP is to unstable to convert the machine to virtual machine using VMware vCenter Converter Standalone. So I installed the DELL's Hard Disk in my computer and used Disk2vhd to convert the Hard Disk to a .VHD volume.

I then used Virtual Box to create a Virtual Machine for the VHD volume. Before booting, I snapshotted the .VHD and create a backup. The Virtual Machine would not boot, instead the screen would just be black.

So I created a batch file to easily mount and unmount the VHD volume:
Code:
@ECHO off
TITLE Mount WindowsXP Disk
ECHO.
SETLOCAL

::Set Directory to Current Batch File Location
set CurDir=%CD%
cd /d %CurDir%
set DiskDir=%CD%\WindowsXP.vhd
ECHO %DiskDir%

SET DiskPartScript="%TEMP%DiskpartScript.txt"
ECHO SELECT VDISK FILE="%DiskDir%" > %DiskpartScript%
ECHO ATTACH VDISK >> %DiskpartScript%

DiskPart /s %DiskpartScript%

ECHO.
ECHO LogFile at: %DiskpartScript%

ENDLOCAL
ECHO.
pause

I figured I needed to replace the Hardware Abstraction Layer. I mounted the VHD using the above script and mounted a Windows XP CD image to another drive. I then opened the command prompt on V: \Windows\System32 (V: \ is where the .VHD was mounted) and entered the commands:
Code:
expand D:\I386\HALACPI.DL_ V:\Windows\System32
copy V:\Windows\System32\HALACPI.DL_ V:\Windows\System32\HAL.DLL

I then unmounted the VHD using the code:
Code:
@ECHO off
TITLE unMount WindowsXP Disk
ECHO.
SETLOCAL

::Set Directory to Current Batch File Location
set CurDir=%CD%
cd /d %CurDir%
set DiskDir=%CD%\WindowsXP.vhd
ECHO %DiskDir%

SET DiskPartScript="%TEMP%DiskpartScript.txt"
ECHO SELECT VDISK FILE="%DiskDir%" > %DiskpartScript%
ECHO DETACH VDISK >> %DiskpartScript%

DiskPart /s %DiskpartScript%

ECHO.
ECHO LogFile at %DiskpartScript%

ENDLOCAL
ECHO.
pause

I tried booting the Virtual Machine again, only to receive this:
ErPbZcV.png


This BSOD occurs just before reaching the desktop in both safemode and regular mode and I am out of ideas to fix it. I've tried, with no success, using the Windows XP repair install tool and chkdsk /r. Both had no affect.
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
What is happening is because XP is sensitive to the hard drive controller change, if it does not see the the controller that the VM machine has or the generic ms ahci controller it will cause this bluescreen error

What you would have to do is one of two things
1) in the vm, you should be able to specify a standard ide controller and it should boot up, instead of the sata/ahci controller

2) on the old machine enable the generic msahci controller and the reimage the drive the way that you did
 

DerekZ06

Member
Feb 19, 2008
36
0
0
Using IDE PIIX3 I get BSOD 0x7B right at boot
Using IDE PIIX4 I get BSOD 0x7E just before desktop (What I was using before)
Using IDE ICH6 I get BSOD 0x7B right at boot
Using SATA AHCI I get BSOD 0x7B right at boot

The PIIX4 is the only one that brings up the Windows XP loading screen. The bar Swipes across about 6 times before BSOD.

Booting the old machine isn't an option. As the machine will BSOD with 0x7F. In safe mode and regular. Microsoft says it's generally caused by:
+ Low-level hardware corruption, such as corrupt memory (RAM)
+ Mismatched memory modules
+ A malfunctioning motherboard
http://support.microsoft.com/kb/137539

This was the original problem. Given the age of the machine (11years), and that the machine stopped working after a thunderstorm power outage, I assume the error is definitely hardware related and not Windows related. But I haven't done any further diagnostics on the machine to verify it to be hardware, it just seems so very likely that it is hardware.
 
Last edited:

DerekZ06

Member
Feb 19, 2008
36
0
0
I redid the Hal file again, this time using the recovery CD, but it had no effect except windows xp no longer seems to be doing any dumps. There is no minidump or even a minidump folder in F: \Windows.

However, I did find that it was creating a dumpfile with the .tmp extension in the root of the C drive. I copied the file then renamed it with the .dmp extension, then opened it with bluescreen view. The results are below. Not sure if it helps anything.

K6yMnsR.png
 

DerekZ06

Member
Feb 19, 2008
36
0
0
It's working. The problem was with the System Reserved Partition.

Every time I mounted the VHD, Windows would message me about formatting the volume that was once the System Reserved. Doing so caused even more serious problems with the virtual machine.

What finally worked:

I mounted the VHD and used testdisk_win to repair the partition table using this guide here:
http://www.techsupportforum.com/for...rtition-or-files-in-your-computer-194492.html

Next I unmounted the VHD and booted the Virtual machine. It then went into windows setup to finish the repair install. After it finished, windows booted and I was greeted with the message, "Windows Must be activated before logging in!" Luckily, the key that came with the computer on the side of the tower worked. Now it's sitting at desktop working fine.
 

Dahak

Diamond Member
Mar 2, 2000
3,752
25
91
Nice that you go it to work. To be honest, I would not thought of a partition issue, let alone the small system reserved partition.