How Do I Migrate My VHD Boot x64 System Install to a New Hardware? Enabling AHCI in Windows 8 After OS Install RRS feed

  • Question

  • Hello,

    I am running a VHD boot Windows 8 x64 setup in a Core2 Duo CPU with Intel platform hardware (it's an ASUS motherboard).

    I want to swap my hardware to Intel i5 hardware. How do I do make my operating system setup to this new hardware the best way?

    The 'brute-force' plugging of the HDD with the system partition does not work. The system fails to boot and falls into the blues screen with a fault in SATA drivers (0x07 if I remember the STOP code correctly). I guess this is because of the different north bridge.

    In Windows XP you could repair the OS from the Setup CD. How do you do it in Windows 8? I would love to save my settings and programs intact.

    Thank you.

    Well this is the world we live in And these are the hands we're given...

    Saturday, May 5, 2012 12:39 PM

All replies

  • STOP 0x7B? Whas the old HDD running in IDE mode? If yes, setup the new HDD also in IDE mode.

    "A programmer is just a tool which converts caffeine into code"

    Sunday, May 6, 2012 6:17 PM
  • You should have the VHD. Refer to the following article to create native boot virtual system.

    Native VHD Dual Boot to Windows 8 Consumer Preview with Windows 7

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

    Tuesday, May 8, 2012 6:49 AM
  • Yep, Andre, the SATA controller is set to working in IDE compatible mode in BIOS (that's a non-UEFI BIOS). That's both the current PC and the one I want to move my VHD to have their controllers set to IDE compatible mode. Do I have to enable the AHCI mode on the target PC?

    Thank you.

    Well this is the world we live in And these are the hands we're given...

    Thursday, May 10, 2012 10:09 AM
  • Dear Arthur,

    I think there must be some misunderstanding here. I already boot into the VHD. All I want is to plug my existing HDD with a VHD on it to a new hardware. The question is: how do I do that without getting a BSOD?

    Well this is the world we live in And these are the hands we're given...

    Thursday, May 10, 2012 10:10 AM
  • Do I have to follow these guidelines (http://support.microsoft.com/kb/922976) on the source PC before I plug my HDD to a new PC?

    Instruction guidelines say the following:

    Locate and then click  one of the following registry subkeys:


    In other words, the guidelines recommend enabling two drivers: the Msahci.sys and the IastorV.sys, then turn off, enable AHCI mode on a new PC and plug the HDD to the PC, correct?

    Also, what if I enable the Iastore on a target system and leave the IDE mode enabled? Will I be able to boot on existing system?

    Well this is the world we live in And these are the hands we're given...

    Thursday, May 10, 2012 10:51 AM
  • I don't have any registry key for the Msahci driver. The Start value for the IastorV is already set to 0.

    Any clue how to enable AHCI?

    There's a different AHCI driver for Windows 8:


    If anybody is curious, see here for details.

    Enabling the driver does not help. So it feels like you can't switch from IDE to AHCI mode if the BIOS had IDE chosen at the time OS was being installed, correct?

    Well this is the world we live in And these are the hands we're given...

    Friday, May 11, 2012 9:39 AM
  • Your question isn't really clear, what is the main OS?  The main OS boots OK you have a problem when booting from VHD only?

    If the main OS is Windows 7 you can mount the Windows 8 VHD.

    Then run regedit and select the HKLM key.

    Go to File->Load Hive and browse whatever drive you have the VHD mounted on.

    Find drive:\windows\system32\config and load the SYSTEM hive.

    Now you can tweak the Start values for the controller drivers for the VHD.  Maybe you are already doing that? 

    Here are my reg key values on AHCI system, maybe there are some dependencies.  I looked and the driver loaded is iastor.  iastorV is used when the controller is in RAID mode.

    iastor 0

    iastorV 0

    iastorSV 0

    storahci 0

    storflt 0

    storsvc 3

    storvsc 0

    storvsp 3

    • Edited by dgobe Friday, May 11, 2012 1:28 PM
    Friday, May 11, 2012 1:26 PM
  • MS renamed the AHCI driver to StorAHCI. But I think Win8 fails because you change too many hardware components. What you can try is to sysprep the VHD.

    "A programmer is just a tool which converts caffeine into code"

    Friday, May 11, 2012 9:50 PM
  • Thanks! What you mean by 'the main OS', however? I have a multiboot of:

    Windows Server 2008 R2 - Normal boot.

    Windows Developer Preview - VHD boot.

    Windows Consumer Preview - VHD boot.

    The Windows Consumer Preview is chosen as a default OS. The VHD is located on a non-system partition.

    I plan to remove the HDD, plug to a new hardware, boot from the UFD flash, and attach the VHD, the Upgrade.

    Well this is the world we live in And these are the hands we're given...

    Monday, May 21, 2012 10:50 AM
  • Thanks, Andre. Will sysprep/generalize work as usual? What about Metro style apps? Will they be saved?

    Well this is the world we live in And these are the hands we're given...

    Monday, May 21, 2012 10:51 AM
  • Yikes! Seems like you can't sysprep Windows 8! There's no such a command.

    Well this is the world we live in And these are the hands we're given... Ah, it's up one folder: .\sysprep\

    Monday, May 21, 2012 1:23 PM
  • Gentlemen, could somebody please support me with my migration. I'm sort of puzzled with getting my PC with the new hardware booted.

    What I've had on the old hardware:

    1. A multiboot configuration with boot files on a plain HDD0 drive's system partition 0.

    2. Separate virtual boot partition on a VHD file located on a HDD1 partition 0.

    Now I moved the HDD1 to a new PC. I have the old VHD with Windows 8 Consumer Preview installed there residing on this HDD1. Of course, when trying to boot the PC, nothing happens because there are no boot files on this HDD1, all boot files, the mbr, the bcd database, etc are all residing on the HDD0 on my old PC.

    I am trying to get the new PC booted from the VHD file I have. The problem is: I can't do that, neither the BIOS, nor the UEFI BIOS do see the boot device.

    I did the following:

    1. Booted from the USB stick into the Windows 8 Consumer Preview setup disk (The MinWin).

    2. Started the command prompt from there by pressing Shift+F10.

    3. In the command prompt window I typed the following:

    c:\>bootsect /nt60 c: /force

    to patch the primary partition of the HDD1 (now HDD0 on a new PC) with the boot sector.

    This returns the following message:

    This set of volumes will be updated with bootmgr compatible bootcode C: (\\?\Volume{GUID})

    4. Attached the VHD to the MinWin with the diskpart:

    diskpart> select disk 0

    diskpart> select vdisk file=c:\win8cp.vhd

    diskpart> attach vdisk

    diskpart> exit

    5. Copied the BCD data from the VHD drive (the f:\ logical letter) to the primary partition of the HDD0:

    C:\>bcdboot f:\windows /s c: /f ALL /v /b {GUID}
    where {GUID} = the GUID returned by the bootsect ran on step 3.

    6. Created the boot BCD database store with the script posted on http://reboot.pro/12466/

    I'm quoting the script here.

    set VHD-File-Path=%2
    set bootmgr-Partition=%3
    set BCD-File=%4
    set VHD-File-Path=%1
    set bootmgr-Partition=%2
    set BCD-File=%3
    IF NOT DEFINED VHD-File-Path SET VHD-File-Path=%~d0\win7.vhd
    CALL :SETVHD %VHD-File-Path%
    IF NOT DEFINED bootmgr-Partition SET bootmgr-Partition=%VHD-Partition%
    IF NOT DEFINED BCD-File (SET BCD-File=%bootmgr-Partition%\boot\BCD)
    IF NOT EXIST "%VHD-Partition%%VHD-File%" (ECHO "%VHD-Partition%%VHD-File%" does not exist. & ECHO Exiting ... & GOTO :SETVHDBTHELP)
    IF NOT EXIST "%bootmgr-Partition%\bootmgr" (ECHO "%bootmgr-Partition%\bootmgr" does not exist. & ECHO Exiting ... & GOTO :SETVHDBTHELP)
    ECHO Please confirm the settings:
    ECHO =======================================
    ECHO VHD File is %VHD-Partition%%VHD-File%
    ECHO BCD File is %BCD-File%
    ECHO Bootmgr Partition is %bootmgr-Partition%
    IF %HAL%.==Y. ECHO Detecthal is Yes
    ECHO =======================================
    SET GoAhead=
    SET /P GoAhead=Type yes followed by ENTER to continue/ENTER to exit: 
    IF /I NOT %GoAhead%.==yes. (ECHO Exiting... & GOTO :EOF)
    IF /I NOT %GoAhead%.==yes. (ECHO Exiting... & GOTO :EOF)
    bcdedit /createstore %BCD-File%
    for /f "tokens=1-3" %%a in ('bcdedit /store %BCD-File% /create /d "Windows 7" /application osloader') do set guid=%%c
    bcdedit /store %BCD-File% /set %guid% systemroot \Windows
    bcdedit /store %BCD-File% /set %guid% path \Windows\system32\winload.exe
    bcdedit /store %BCD-File% /set %guid% device vhd=[%VHD-Partition%]%VHD-File% 
    bcdedit /store %BCD-File% /set %guid% osdevice vhd=[%VHD-Partition%]%VHD-File%
    IF %HAL%.==Y. bcdedit /store %BCD-File% /set %guid% detecthal yes
    bcdedit /store %BCD-File% /create {bootmgr} /d "Windows 7 BootManager"  
    bcdedit /store %BCD-File% /set {bootmgr} timeout 6 
    bcdedit /store %BCD-File% /set {bootmgr} displayorder %guid%
    bcdedit /store %BCD-File% /set {bootmgr} device partition=%bootmgr-Partition%
    bcdedit /store %BCD-File% /set {bootmgr} path \bootmgr
    bcdedit /store %BCD-File% /default %guid%
    ECHO Content of %BCD-FILE%
    ECHO -----------------------
    bcdedit /store %BCD-File% /enum all
    SET VHD-Partition=%~d1
    SET VHD-File=%~pnx1
    SET GoAhead=
    ECHO "%1" exists. 
    IF /I NOT %~pnx1.==\boot\bcd. GOTO :BCDDELETE
    ECHO Will not delete %1 for safety reasons. 
    ECHO Please delete it manually, if you want to overwrite it. 
    ECHO Exiting for your safety ... 
    SET /P GoAhead=Type yes to confirm delete of %1, if you are sure: 
    IF /I NOT %GoAhead%.==yes. (SET GoAhead= & GOTO :EOF)
    ECHO Deleting %1
    DEL %1
    ECHO Usage: %~nx0 [/h] [vhd-file [bootmgr-partition [bcd-file]]]
    ECHO        %~nx0 /? 
    ECHO    vhd-file is the name of the vhd file
    ECHO    /h is to include a directive to detecthal (sets detecthal to yes)
    ECHO    bootmgr-partition is the partition at the root of which bootmgr is found
    ECHO    bcd-file is the name of the bcd file - need not be the final bcd location
    ECHO       This file can later be copied to the needed location
    ECHO    One or more parameters can be left out.
    ECHO    The default values respectively are currentpartition:\win7.vhd currentpartition: currentpartition:\boot\bcd
    ECHO    The tool will not delete \boot\bcd in any partition - for safety.  User needs to manually delete it, as needed
    ECHO     %~nx0 
    ECHO     %~nx0 d:\windows7.vhd f: e:\mywork\boot\bcd
    ECHO     %~nx0 /h d:\windows7.vhd f: e:\mywork\boot\bcd
    ECHO     %~nx0 /? (to get the usage)  

    7. Tried to rebuild the BCD:


    Scanning all drives...

    Total identified Windows installations: 1

    [1] F:\Windows

    Add installation to boot list? y

    Element not found.

    Gentlemen, could you please help me? What am I doing wrong here?

    Here is the output of the created BCD boot database:

    c:\>bcdedit /store c:\DATA\BCD /enum

    Windows Boot Manager

    identifier {bootmgr}

    device partition = c:

    path \bootmgr

    description Windows 7

    default {default}

    displayorder {default}

    timeout 6

    Windows Boot Loader

    identifier {default}

    device vhd=[c:]\win8cp.vhd

    path \windows\system32\winload.exe

    description Windows 7

    os device vhd=[c:]\win8cp.vhd

    systemroot \Windows

    I tried both BIOS and UEFI BIOS types with IDE / AHCI modes enabled (the VHD has been created on the old PC which had IDE mode selected for SATA controller). All to no avail. The system is not going to boot.

    I appreciate your help.

    Thank you.

    Well this is the world we live in And these are the hands we're given...

    Monday, May 21, 2012 11:01 PM
  • Sorry, I haven't used sysprep with VHD and moved the syspreped VHD so I have no idea if this works.

    "A programmer is just a tool which converts caffeine into code"

    Tuesday, May 22, 2012 8:29 PM
  • I figured it out. Somehow the Active bit has gone walkies. I marked the primary physical partition as active and that made the BIOS to see the bootmgr.

    DISKPART> select disk 0

    DISKPART> list partition

    DISKPART> select partition 1

    DISKPART> active

    DISKPART> exit

    Well this is the world we live in And these are the hands we're given...

    Monday, May 28, 2012 8:09 AM