Physical To Virtual (P2V) Windows Migration All Version – Virtualbox / VMware / Hyper-V / Citrix hack

I was working on to migrate an old machine which has some old licensed accounting software that needs to be preserved. The physical hardware is old and beyond repair. Had to attempt a migration so that i could be able to extract necessary database settings, license and misc data from the accounting software. Direct migration might result in Blue Screen Of Death (BSOD) in windows with STOP: 0x0000007B error. This guide will help to walk through and provide you clues to get your migrated Windows in VM working.

So in desperation, i decided to try migrate the Windows Vista Home Premium operating system by doing hard disk raw copy and then convert the raw hdd .img file into a Virtualbox .vmdk file.

I used tool to do the raw copy, you can also use linux dd command line to copy the raw data of the physical hard disk into a raw image file (.img). Then from Virtualbox convert that raw image file to compatible virtual hard disk file – .vmdk, vdi, vhd format.

Thats the easy part. Now here is where the fun begins. Windows already registered the set of hardware devices in registry and you may already have some drivers installed which can cause the BSOD. Simplify your VM settings down to basic. Settings may vary depending on what you migrated from.

My Virtualbox settings are as follows:

  • Paravirtualized settings set to none. Disabled PAE and used PIIX3 for chipset settings
  • I removed all SATA settings, i used IDE controllers instead and set it to PIIX3 (I/O Cache disabled)
  • I removed audio and network for a start. (only re-enable these when your VM successfully boots at the end of the whole thing)
  • USB settings set to 1.0 (legacy)
  • Everything else typically default upon your VirtualBox template settings when you create a new VM. For storage, i attached the storage that i converted from raw.

I used Lazesoft Windows Recovery free suite to help create the WinPE / Boot disk base on my version of windows. This has helped me safe a lot of trouble. Lazesoft boot disk has the necessary features you needed. CHKDSK, SFC scan, Boot sector fixer, MBR fixer etc.

First time booting VM, i boot into Lazesoft boot disk and do the following:

  • Scan the disk with chkdsk.
  • i did an SFC scan as well.
  • Backup MBR, BCD and Registry.
  • I start editing the registry and ensure that my registry has matching criteria below.

Editing the registry while in Lazesoft with reference from MS Technet blog:

  1. Check the file system and registry for these entries
    • Confirm Files Exist
      • windows\system32\drivers\intelide.sys
      • windows\system32\drivers\pciide.sys
      • windows\system32\drivers\atapi.sys
    • Confirm Registry Entries Exist
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_8086&dev_7111
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\pci#ven_8086&dev_7110&cc_0601
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\primary_ide_channel
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\CriticalDeviceDatabase\secondary_ide_channel
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\IntelIde
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\PCIIde
      • HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\atapi

Any missing items from step #3 can be remedied through the information given below. Hyper-V requires these critical devices and services to boot; a lack of this information in Windows will result in a 0x0000007B, or perpetually rebooting machine.

Required Registry Critical Boot Entries





Required Registry Service Entries




Required Driver Files

  • windows\system32\drivers\intelide.sys
  • windows\system32\drivers\pciide.sys
  • windows\system32\drivers\atapi.sys
Any missing file may be available from a .CAB within \windows\Driver Cache\

At this point, you have done the necessary to get the VM booted up in basic mode. Always try to work backwards and always take notice of the STOP code / Error codes. For the first boot up, i always suggest booting up in safe mode first (without networking). Then try boot up normally.

** additional step i took ** moved / removed crcdisk.sys and pcmcia.sys out from \windows\system32\drivers folder to stop it from loading on boot.

For my case, i stumble addtional issues. I had to manually remove AVG from booting at start which was causing the bluescreen. Basically removing the AVG .sys files from Windows\System32\drivers\ 

Last but not least, when you converted your raw .img to .vmdk / .vdi / .vhd, always make a backup before you start venturing the guide and work on your fix. Will save you a lot of time from doing another raw to virtual disk conversion again.

On personal note. I know this guide would work for Windows XP / Vista and 7 as i personally done it before. Windows 8 and 10 would probably have different things to look it when you hit the BSOD / stop errors on boot. Also, you are probably violating windows licensing doing so, so do it at your own risk. For my case, my Windows will always gets deactivated when i carry out such migration and requires a re-activation.

Good luck!



Leave a Reply