none
Windows Server 2008 R2 - Boot from VHD

Answers

  • Hi,

    Regarding your questions:

    1.    You can prepare(surface) a VHD before installing a OS on it.
    2.    You cannot install Windows 7/Windows 2008 R2 on a VHD file before surfacing it. You will not lose OS on it.
    3.    Differencing disk is supported. You can surface differencing disk or their parent disk. Please note, if you surface parent disk and if you make any changes, those changes will affect all differencing systems.

    Here are some articles and video about booting from VHD.
    http://blogs.msdn.com/cesardelatorre/archive/2009/01/11/windows-7-natively-booting-from-a-vhd-virtual-pc-image-file.aspx

    Inside Windows 2008 R2 Virtualization Improvements and Native VHD Support (Mark Russinovich)
    http://www.microsoft.com/emea/teched2008/itpro/tv/default.aspx

    Hope them help.

    Thanks.

    Monday, January 12, 2009 9:05 AM
    Moderator
  • Hi Roel, yes I am using the 7000 build too, and it could be that the 7000 bits have some inconsistances between the diskpart, SetupCD and BCD.
    I remember, the manual setup to VHD created the BCD records with "file=" syntax for me too.

    Great, I must have overseen the merge option in diskpart ;) let's destroy another VHD installation :)

    Regarding the parent/differencing disk concept, I was actualy able to boot to all of them until I touched the parent system (updated VGA drivers).

    When I am looking at your test scenario results, i would say we have learned one simply rule:
    "Dont touch any VHD which is parent to some differencing VHD"

    I think the merge is usable only in one diff VHD for one parent VHD scenario, for example when you install some new app or driver and you want to have a possibility to rollback.

    regards

    Lubomir

    PS: I have recreated the diff files and I am able to boot to both of them again
    • Marked as answer by Roel Janssens Monday, February 02, 2009 3:13 PM
    Monday, February 02, 2009 2:41 PM
  • I did solve the BSOD!

    When the vhd is created from within diskpart by default (if you don't specify it's type) it is created as a dynamically expanding vhd.
    When I create the vdisk with the parameter type=fixed everything works as expected, in fact, I'm typing this on my first Windows 7 installation booted natively from vhd :)

    create vdisk file=c:\vhd\win7.vhd maxiumum=40000 type=fixed
    select vdisk file=c:\vhd\win7.vhd
    attach vdisk

    bcdedit /set {GUID} device file=[c:]\vhd\win7.vhd
    bcdedit /set {GUID} osdevice file=[c:]\vhd\win7.vhd

    • Marked as answer by Roel Janssens Thursday, January 22, 2009 11:51 AM
    Thursday, January 22, 2009 10:08 AM
  • Mervyn Zhang said:

    Inside Windows 2008 R2 Virtualization Improvements and Native VHD Support (Mark Russinovich)
    http://www.microsoft.com/emea/teched2008/itpro/tv/default.aspx

    The answer to my differencing question was in that video, thanks again Mervyn! Here are two screenshots I captured from that presentation (why can't we use embedded images on this forum)

    BCD output with two differencing entries, image is blurry
    http://bol43a.bay.livefilestore.com/y1pDcBQxP68Yrh3MqROYzYm5qgOMez0Jt_EmoN3L5vrrTMtTo3PqWPcP84BXQtuKem_LS3Zn7aHTWmMnKirq82BeQ/BCD Mark Russinovich 1.jpg

    BCD output zoomed in on one diff entry, sharp image
    http://bol43a.bay.livefilestore.com/y1pP3diogiMydLuEDJSMO21gw8EZqiYGHMvCrBrChZrRJnwPa1f9oQfFR0Mg5dOF1aJbbHMMePPSHscDvW2XI9OKA/BCD Mark Russinovich 2.jpg

    Right after seeing Mark's Magic Word [locate] I tried that in my BCD and voila, the diff entry boots! Right now I have a base Windows 7 installation and a differencing Windows 7 installation and I can boot from and work into both of them. Both environments are completely seperated from each other: what you do in one installation won't be seen in the other and vice versa. Now that this 'project' is finished I can start to figure out how the merging process works, especially if there are multiple differencing chains attached. Feel free to share any thoughts about that :-)

    This is the relevant portion of my current bcdedit /v

    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3a8-ea73-11dd-8883-93ffb4e65061}  
    device                  file=[C:]\VHD\Win7-base.vhd  
    path                    \Windows\system32\winload.exe  
    description             Windows 7 Base  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    recoverysequence        {c56bf3a6-ea73-11dd-8883-93ffb4e65061}  
    recoveryenabled         Yes  
    osdevice                file=[C:]\VHD\Win7-base.vhd  
    systemroot              \Windows  
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}  
    nx                      OptIn  
     
    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3aa-ea73-11dd-8883-93ffb4e65061}  
    device                  vhd=[locate]\VHD\Win7-diff.vhd,locate=custom:12000002  
    path                    \Windows\system32\winload.exe  
    description             Windows 7 Diff  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    osdevice                vhd=[locate]\VHD\Win7-diff.vhd,locate=custom:22000002  
    systemroot              \Windows  
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}  
    nx                      OptIn 

    In the 'Windows 7 Diff' entry I created 'device' and 'osdevice' by typing in the following commands (the custom: stuff was added automatically)

    bcdedit /set {c56bf3aa-ea73-11dd-8883-93ffb4e65061} device vhd=[locate]\VHD\Win7-diff.vhd
    bcdedit /set {c56bf3aa-ea73-11dd-8883-93ffb4e65061} osdevice vhd=[locate]\VHD\Win7-diff.vhd

    Notice the difference when you use this command when you create a base disk:

    When you reference a base disk you have to use file=
    When you reference a diff disk you have to use vhd=

    I can remember that there was some confusion about above commands between build 7000 and previous builds, maybe this is a leftover from that and they forgot to include differencing disks? This is a beta after all, so that would be a possible explanation.

    Everyone who helped me thanks again, I hope this thread is useful to others too.

    • Edited by Roel Janssens Tuesday, January 27, 2009 9:57 PM enhanced formatting
    • Marked as answer by Roel Janssens Tuesday, January 27, 2009 10:06 PM
    Tuesday, January 27, 2009 9:50 PM

All replies

  • Hi,

    Regarding your questions:

    1.    You can prepare(surface) a VHD before installing a OS on it.
    2.    You cannot install Windows 7/Windows 2008 R2 on a VHD file before surfacing it. You will not lose OS on it.
    3.    Differencing disk is supported. You can surface differencing disk or their parent disk. Please note, if you surface parent disk and if you make any changes, those changes will affect all differencing systems.

    Here are some articles and video about booting from VHD.
    http://blogs.msdn.com/cesardelatorre/archive/2009/01/11/windows-7-natively-booting-from-a-vhd-virtual-pc-image-file.aspx

    Inside Windows 2008 R2 Virtualization Improvements and Native VHD Support (Mark Russinovich)
    http://www.microsoft.com/emea/teched2008/itpro/tv/default.aspx

    Hope them help.

    Thanks.

    Monday, January 12, 2009 9:05 AM
    Moderator
  • Hi, Nice of you to refer to my post, In the version you are talking about there is no surface any more, it is called attach. for the rest i tested everything with build 7000 ( beta 1) and it works, also Server 2008 R2 will boot from expandable VHD file, so no need to reserve diskspace for a dual boot system and waste it because it will never be used.
    fun thing now is, I have a laptop that runs server 2008 R2 from VHD with hyper-V underneeth.
    I really love this build.
    Eric Denekamp
    MCT
    Tuesday, January 13, 2009 9:19 AM
  • Hi Eric, the situation on your laptop is exactly the situation I want on my laptop ;-)

    The current harddrive in my laptop has two partitions from 40GB each, I made a dualboot between Vista Enterprise and Windows Server 2008 R2 (of course with Hyper-V enabled). After confirming this works, I tried to add a boot entry for Windows 7 by reading the following guides:

    http://blogs.infosupport.com/ericd/archive/2008/11/12/Boot-your-machine-from-VHD.aspx : Your Guide, maybe the first on the whole internet
    http://tsharpe79.spaces.live.com/blog/cns!2DBB8237D53BD2B!3173.entry : A little more detailed, also describes adding WinPE as a boot entry
    http://blogs.msdn.com/cesardelatorre/default.aspx : Pretty much the same as yours.

    The part of adding Windows 7 to the bootmanager goes fine, also the creation and attaching of the .vhd works. The installation for Windows 7 starts and the image gets expanded to the newly created .vhd. At the first reboot of Windows 7 I see the coloring animated dots and a few seconds later a BSOD with error 0xC000000F.

    This is my currect BCD, maybe there is something wrong in here?

    C:\Users\Administrator>bcdedit /v  
     
    Windows Boot Manager  
    --------------------  
    identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}  
    device                  partition=D:  
    description             Windows Boot Manager  
    locale                  en-US  
    inherit                 {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}  
    default                 {c552e40b-dbcf-11dd-94da-00217082cf29}  
    resumeobject            {c552e40a-dbcf-11dd-94da-00217082cf29}  
    displayorder            {c552e40b-dbcf-11dd-94da-00217082cf29}  
                            {c552e402-dbcf-11dd-94da-00217082cf29}  
                            {4ca68f7a-dc02-11dd-b7a4-de968cac6af1}  
    toolsdisplayorder       {b2721d73-1db4-4c62-bf78-c548a880142d}  
    timeout                 10  
     
    Windows Boot Loader  
    -------------------  
    identifier              {c552e40b-dbcf-11dd-94da-00217082cf29}  
    device                  vhd=[C:]\VHD\VM-BKGM14J-Win7\VM-BKGM14J-Win7.vhd,locate=custom:12000002  
    path                    \Windows\system32\winload.exe  
    description             Windows 7  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    osdevice                vhd=[C:]\VHD\VM-BKGM14J-Win7\VM-BKGM14J-Win7.vhd,locate=custom:22000002  
    systemroot              \Windows  
    resumeobject            {c552e40a-dbcf-11dd-94da-00217082cf29}  
    nx                      OptIn  
    detecthal               Yes  
     
    Windows Boot Loader  
    -------------------  
    identifier              {c552e402-dbcf-11dd-94da-00217082cf29}  
    device                  partition=C:  
    path                    \Windows\system32\winload.exe  
    description             Windows Server 2008 R2  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    recoverysequence        {c552e403-dbcf-11dd-94da-00217082cf29}  
    recoveryenabled         Yes  
    osdevice                partition=C:  
    systemroot              \Windows  
    resumeobject            {c552e401-dbcf-11dd-94da-00217082cf29}  
    nx                      OptIn  
    hypervisorlaunchtype    Auto  
     
    Windows Boot Loader  
    -------------------  
    identifier              {4ca68f7a-dc02-11dd-b7a4-de968cac6af1}  
    device                  partition=D:  
    path                    \Windows\system32\winload.exe  
    description             Windows Vista Enterprise  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    bootdebug               No  
    osdevice                partition=D:  
    systemroot              \Windows  
    resumeobject            {4ca68f7b-dc02-11dd-b7a4-de968cac6af1}  
    nx                      OptOut 

    Or maybe it is that I am mixing two beta's in one BCD ... although Windows 7 and Windows Server 2008 R2 are "the same" ...
    Tuesday, January 13, 2009 10:58 AM
  • I'm a little but further, but still get a BSOD.

    In all above "VHD-Booting-Guides" there is an error regarding device & osdevice, they all instruct you to specify vhd as the device and osdevice:

    bcdedit /set {GUID} device vhd=[C:]\VHD\Win7.vhd  
    bcdedit /set {GUID} osdevice vhd=[C:]\VHD\Win7.vhd 

    These values should be changed to file=[C:] instead of vhd=[C:]

    bcdedit /set {GUID} device file=[C:]\VHD\Win7.vhd  
    bcdedit /set {GUID} osdevice file=[C:]\VHD\Win7.vhd 

    After this change Windows 7 boots from the .vhd, the OS is starting but a few seconds after the coloring bubbles a get a BSOD with status 0x0000012F and message "An initialization failure occured while attempting to boot from a VHD"

    Any thoughts?
    Tuesday, January 13, 2009 2:25 PM
  • Mervyn Zhang said:

    Inside Windows 2008 R2 Virtualization Improvements and Native VHD Support (Mark Russinovich)
    http://www.microsoft.com/emea/teched2008/itpro/tv/default.aspx

    Many thanks for that webcast, watched it yesterday evening and enjoyed it a lot!
    Do you have more URL's like that? I mean webcasts/presentations about Hyper-V 2.0 and/or Mark Russinovich.
    Wednesday, January 14, 2009 1:39 PM
  • Roel Janssens said:
    After this change Windows 7 boots from the .vhd, the OS is starting but a few seconds after the coloring bubbles a get a BSOD with status 0x0000012F and message "An initialization failure occured while attempting to boot from a VHD"

    Any thoughts?


    There are some situations that I've seen where VHD boot isn't working reliably. Let me see if I can find some more information on possible fixes.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, January 14, 2009 4:15 PM
    Owner
  • I did solve the BSOD!

    When the vhd is created from within diskpart by default (if you don't specify it's type) it is created as a dynamically expanding vhd.
    When I create the vdisk with the parameter type=fixed everything works as expected, in fact, I'm typing this on my first Windows 7 installation booted natively from vhd :)

    create vdisk file=c:\vhd\win7.vhd maxiumum=40000 type=fixed
    select vdisk file=c:\vhd\win7.vhd
    attach vdisk

    bcdedit /set {GUID} device file=[c:]\vhd\win7.vhd
    bcdedit /set {GUID} osdevice file=[c:]\vhd\win7.vhd

    • Marked as answer by Roel Janssens Thursday, January 22, 2009 11:51 AM
    Thursday, January 22, 2009 10:08 AM
  • Mervyn Zhang said:

    3.    Differencing disk is supported. You can surface differencing disk or their parent disk. Please note, if you surface parent disk and if you make any changes, those changes will affect all differencing systems.

    Mervyn, is there any procedure available of how to create a differencing vhd and corresponding boot entry?
    Right now I have a my Windows 7 booted from vhd and it works perfectly, but I want to experiment a little further ;-)

    Friday, January 23, 2009 11:12 PM
  • I do not know how to do it with diskpart - but you can create a differencing disk with Hyper-V and use that.
    Cheers,
    Benjamin Armstrong
    ============================
    Windows Virtualization
    Senior Lead Program Manager

    This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.
    Friday, January 23, 2009 11:36 PM
    Owner
  • Hi,

    You can add parent="PARENT VHD" parameter to create a differencing disk.

    Thanks.

     

     


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Monday, January 26, 2009 12:55 AM
    Moderator
  • Okay, the process of creating a differencing disk wasn't that hard, be it via diskpart or Hyper-V Manager.
    For simplicity I placed both vhd's in the same directory and named them Win7Base.vhd and Win7Diff.vhd.

    First thing I did was copying the existing boot entry to a new one:

    bcdedit /copy {GUID-Win7Base} /d "Windows 7 Diff"

    Next I modified device & osdevice to point to the differencing vhd

    bcdedit /set {GUID-Win7Diff} device file=[C:]\VHD\Win7Diff.vhd
    bcdedit /set {GUID-Win7Diff} osdevice file=[C:]\VHD\Win7Diff.vhd

    When I boot my machine and choose the diff entry it boots into Startup Repair. After letting Repair run for a few minutes it finds some partitioning errors and will fix them the next reboot. At the next reboot it says it can't fix this (bcd is unmodified). I also tried removing the 'recovering-entries' from the Win7Diff boot entry, after that Startup Repair doesn't run anymore but the loading process stops with an error that winload.exe can't be found.

    When booting from a differencing disk, what exactly should the output of bcdedit /v look like? Mine looks like this at the moment, booting from the entry Win7Base still works. But I have no idea what should be here, I just tried something out (that obviously didn't work out as expected).

    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3a8-ea73-11dd-8883-93ffb4e65061}  
    device                  file=[C:]\VHD\Win7Base.vhd  
    path                    \Windows\system32\winload.exe  
    description             Win7Base
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    recoverysequence        {c56bf3a6-ea73-11dd-8883-93ffb4e65061}  
    recoveryenabled         Yes  
    osdevice                file=[C:]\VHD\Win7Base.vhd  
    systemroot              \Windows  
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}  
    nx                      OptOut  
     
    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3aa-ea73-11dd-8883-93ffb4e65061}
    device                  file=[C:]\VHD\Win7Diff.vhd  
    path                    \Windows\system32\winload.exe
    description             Win7Diff
    locale                  en-US
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
    recoverysequence        {c56bf3a6-ea73-11dd-8883-93ffb4e65061}
    recoveryenabled         Yes
    osdevice                file=[C:]\VHD\Win7Diff.vhd  
    systemroot              \Windows
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}
    nx                      OptOut

    One other thing that might be related: when you have a running Windows 7 installation booted from vhd and for some reason your BCD gets corrupt there is no way to get this installation back in. Just pointing to the vhd doesn't work and start the same repair process I experienced above. If for example I have created a vhd I want to share with my friend (exactly on the same hardware) he couldn't 'attach' this vhd to his BCD. The only way I've found the booting of a vhd works is by actually running the setup on the vhd, let that finish and do a bcdedit /export ;-)

    Any help or thoughts are highly appreciated!

    Monday, January 26, 2009 10:02 PM
  • Mervyn Zhang said:

    Inside Windows 2008 R2 Virtualization Improvements and Native VHD Support (Mark Russinovich)
    http://www.microsoft.com/emea/teched2008/itpro/tv/default.aspx

    The answer to my differencing question was in that video, thanks again Mervyn! Here are two screenshots I captured from that presentation (why can't we use embedded images on this forum)

    BCD output with two differencing entries, image is blurry
    http://bol43a.bay.livefilestore.com/y1pDcBQxP68Yrh3MqROYzYm5qgOMez0Jt_EmoN3L5vrrTMtTo3PqWPcP84BXQtuKem_LS3Zn7aHTWmMnKirq82BeQ/BCD Mark Russinovich 1.jpg

    BCD output zoomed in on one diff entry, sharp image
    http://bol43a.bay.livefilestore.com/y1pP3diogiMydLuEDJSMO21gw8EZqiYGHMvCrBrChZrRJnwPa1f9oQfFR0Mg5dOF1aJbbHMMePPSHscDvW2XI9OKA/BCD Mark Russinovich 2.jpg

    Right after seeing Mark's Magic Word [locate] I tried that in my BCD and voila, the diff entry boots! Right now I have a base Windows 7 installation and a differencing Windows 7 installation and I can boot from and work into both of them. Both environments are completely seperated from each other: what you do in one installation won't be seen in the other and vice versa. Now that this 'project' is finished I can start to figure out how the merging process works, especially if there are multiple differencing chains attached. Feel free to share any thoughts about that :-)

    This is the relevant portion of my current bcdedit /v

    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3a8-ea73-11dd-8883-93ffb4e65061}  
    device                  file=[C:]\VHD\Win7-base.vhd  
    path                    \Windows\system32\winload.exe  
    description             Windows 7 Base  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    recoverysequence        {c56bf3a6-ea73-11dd-8883-93ffb4e65061}  
    recoveryenabled         Yes  
    osdevice                file=[C:]\VHD\Win7-base.vhd  
    systemroot              \Windows  
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}  
    nx                      OptIn  
     
    Windows Boot Loader  
    -------------------  
    identifier              {c56bf3aa-ea73-11dd-8883-93ffb4e65061}  
    device                  vhd=[locate]\VHD\Win7-diff.vhd,locate=custom:12000002  
    path                    \Windows\system32\winload.exe  
    description             Windows 7 Diff  
    locale                  en-US  
    inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}  
    osdevice                vhd=[locate]\VHD\Win7-diff.vhd,locate=custom:22000002  
    systemroot              \Windows  
    resumeobject            {c56bf3a4-ea73-11dd-8883-93ffb4e65061}  
    nx                      OptIn 

    In the 'Windows 7 Diff' entry I created 'device' and 'osdevice' by typing in the following commands (the custom: stuff was added automatically)

    bcdedit /set {c56bf3aa-ea73-11dd-8883-93ffb4e65061} device vhd=[locate]\VHD\Win7-diff.vhd
    bcdedit /set {c56bf3aa-ea73-11dd-8883-93ffb4e65061} osdevice vhd=[locate]\VHD\Win7-diff.vhd

    Notice the difference when you use this command when you create a base disk:

    When you reference a base disk you have to use file=
    When you reference a diff disk you have to use vhd=

    I can remember that there was some confusion about above commands between build 7000 and previous builds, maybe this is a leftover from that and they forgot to include differencing disks? This is a beta after all, so that would be a possible explanation.

    Everyone who helped me thanks again, I hope this thread is useful to others too.

    • Edited by Roel Janssens Tuesday, January 27, 2009 9:57 PM enhanced formatting
    • Marked as answer by Roel Janssens Tuesday, January 27, 2009 10:06 PM
    Tuesday, January 27, 2009 9:50 PM
  • Hi there ;)

    It seems I am on the same boat :) With a small deviation I went through the same tests

    I was able to repair the added W7diff BCD record by using the SetupCD and choosing Repair, but before entering Next on the first setup screen I had to start the commandline (Shift+F10) and attach the differencing VHD disk using diskpart, then was the repair process successful, well the parent VHD disappeared from BCD :( So I ended with just one VHD boot record the differencing one.


    Windows Boot Loader
    -------------------
    identifier              {9c78d5a8-e687-11dd-aace-932dd42f79b8}
    device                  file=[D:]\system2diff.vhd
    path                    \Windows\system32\winload.exe
    description             Windows 7 Ultimate (recovered)
    osdevice                unknown
    systemroot              file=[D:]\system2diff.vhd
    resumeobject            {f27a4365-e92a-11dd-a4cd-806e6f6e6963}

    And when I am thinking about it, I am not sure we should boot to the parent disk at all (change it), because it will make the differencing disk confused. I am guite new to the world of differencing disks, but I think the concept might be one parent (ReadOnly) + n of differencing disks (R/W).

    In my BCD created by the boot repair I have the "file=[D:]" syntax in device and osdevice fields and it works too. But as I have found out, it works only if there is only one VHD in the BCD. As soon as you create 2 or more BCD entries for VHD you need to use the vhd=[D:] syntax.

    So it looks like the "Magic Word" is the VHD, LOCATE is maybe a good option to specify a relative path, it might be that a USB HDD could be one time D: and other time G:.

    Last time I have played with it I ended with following BCD:

    Windows Boot Loader
    -------------------
    identifier              {9c78d5a8-e687-11dd-aace-932dd42f79b8}
    device                  vhd=[D:]\system2diff.vhd
    path                    \Windows\system32\winload.exe
    description             Windows 7 VHD DIFF
    osdevice                vhd=[D:]\system2diff.vhd
    systemroot              \Windows
    resumeobject            {f27a4365-e92a-11dd-a4cd-806e6f6e6963}

    Windows Boot Loader
    -------------------
    identifier              {0a96d0bd-eed5-11dd-bb8d-001e4fcef6da}
    device                  vhd=[D:]\system2diff2.vhd
    path                    \Windows\system32\winload.exe
    description             Windows 7 VHD DIFF2
    osdevice                vhd=[D:]\system2diff2.vhd
    systemroot              \Windows
    resumeobject            {f27a4365-e92a-11dd-a4cd-806e6f6e6963}

    Windows Boot Loader
    -------------------
    identifier              {0a96d0be-eed5-11dd-bb8d-001e4fcef6da}
    device                  vhd=[D:]\system2.vhd
    path                    \Windows\system32\winload.exe
    description             Windows 7 VHD parent
    osdevice                vhd=[D:]\system2.vhd
    systemroot              \Windows
    resumeobject            {f27a4365-e92a-11dd-a4cd-806e6f6e6963}

    and all systems were able to boot, then I have had the great idea to install updates from WU on the parent VHD system inclusive VGA and NIC drivers :) and since that both my differencing VHD systems are not able to boot, after 10seconds of booting the LCD goes standby and that's all. :(

    So it seems I have to recreate the differencing disks from scratch.

    Friday, January 30, 2009 3:48 PM
  • And I thought I was the only one figuring this stuff out ;-)

    About that disappearing boot entry, that has happened to me a few times also (but always after a repair). I also have Vista on my machine and one time the repair of Vista started ... after the 'repair' ALL entries pointing to a vhd were gone! Now I understand that Vista doesn't understand vhd-entries, but it was a little surprising for me at that time. Now I make /export's of BCD whenever trying something 'dangerous' so I can always go back.

    What you're saying about 1 FILE= entry and the rest must be VHD= entries makes sence, but I don't understand the logic behind it, why would Microsoft confuse things? Or maybe it is the beta bits? On another forum I found the following (but it doesn't explain that vhd/file mixup):

    BCDEDIT /? /formats

    A device can be one of the following types:

        BOOT
        PARTITION=<drive>
        FILE=[<parent>]<path>
        RAMDISK=[<parent>]<path>,<optionsid>
        VHD=[<parent>]<path>,<locatecustom>

    The options for these types are:

        <drive>        A drive letter with a colon and no trailing
                       backslashes.
        <parent>       (Required) Can be either BOOT, LOCATE, or a drive
                       letter with colon.  The square brackets do not
                       indicate that this is optional, but are a literal
                       part of the syntax.
        <path>         A path to the file (or .wim file) from the root of
                       the parent device.
        <optionsid>    The identifier to the device options entry that
                       contains the system deployment image (SDI) options
                       for the RAM disk. This is usually
                       {ramdisksdioptions}.
        <locatecustom> Supplies an optional element used to locate a device
                       within a VHD. The default locate element for a
                       device is its application path (systemroot for an
                       osdevice). Custom values must be specified using
                       custom element sytax (see /? /types customtypes),
                       for example: locate=custom:22000002.

    Your thoughts about differencing disks (ReadOnlyParent and ReadWriteDifferencings) was also my first perception. And that's why I tried out booting in all environments to see the effects. And everything kept on running, even after booting into the childs and back in the parent. Considering my own experiences I find it strange that your differencing disks don't boot anymore, did you try booting into safe mode to see if that works? Recreating the differencing disks is also an option indead.

    But imagine now I want to merge my first differencing disk into his parent. The merge process will work, but I will lose all information in the parent from the moment I created the that first differencing disk ... that is at least what I think will happen. In Hyper-V Manager you also have the option of creating a brand new VHD from a differencing vhd and leave the rest intact, but I don't find this option in diskpart. Diskpart just offers a merge down as you can see below.

    DISKPART> ? merge vdisk

        Merges a child disk with its parents.

    Syntax:  MERGE VDISK DEPTH=<N>

        DEPTH=<N>   Indicates the number of parents to merge together. For example,
                    MERGE=1 indicates one level of the differencing chain should be
                    merged.  The file must have originally SELECTED with a depth greater
                    than equal to the depth specified here.

        A virtual disk must be selected for this operation to succeed.

    Example:

        MERGE VDISK DEPTH=1

        In this example a child virtual disk is merged with its parent:
        CREATE VDISK FILE="c:\vhd2.vhd" MAXIMUM=20000 parent="c:\vhd1.vhd"
        SELECT VDISK FILE="c:\vhd2.vhd" DEPTH=2
        MERGE VDISK DEPTH=1

    After making a few differencing disks to the same parent at different times (or maybe even something more complicated) I can see the situation become very confusing. With snapshots in Hyper-V Manager you get some sort of visualization of how they are named, arranged and dated, it would be cool if such a thing would exist for parent-differencing vhd's too!

    Friday, January 30, 2009 9:14 PM
  • Lubomir, are you running all tests on build 7000?

    I checked my bcdedit /v and there are a lot of file= entries (and they work), so I can't confirm that there should be only one. In fact, Windows when installed on a vhd creates a file= entry by default. That's why I tried that also for differencing entries, but that didn't work, they needed
    vhd=

    To better understand what the differencing and merge process do I made a small test scenario:


              01           03           06
    ------------------------------------------------------------------
    Base.vhd  | 02 Word    |
    ------------------------------------------------------------------
    Diff1.vhd              | 04 Excel   |
    ------------------------------------------------------------------
    Diff2.vhd              | 05 Access  |               | 08 Outlook |
    ------------------------------------------------------------------
    Diff3.vhd                           | 07 Powerpoint |
    ------------------------------------------------------------------

    01 boot DVD, create vhd, install Windows 7 on vhd
    02 install Word (to cache office installation files)
    03 boot DVD, create 2 differencing vhd's and 2 additional boot entries
    04 boot Diff1, install Excel
    05 boot Diff2, install Access
    06 boot DVD, create 1 differencing vhd pointing to Diff2 and 1 additional boot entry
    07 boot Diff3, install Powerpoint
    08 boot Diff2, install Outlook
    09 boot Diff3, BSOD 0x0000007B (0x80D98A90,0xC000000E,0x00000000,0x00000000)
    10 boot DVD, merge Diff1
    11 boot Diff2, Login possible, but a few critical services don't startup
    12 boot Diff1, everything okay
    13 boot Base, everything okay, Excel is installed so the merge worked


    Step 09 seems correct, the parent disk for Diff3 is modified so it doesn't boot up anymore
    Step 11 seems weird: Windows 7 starts and I can login but a few critical services (including network, firewall, etc) don't startup anymore. I expected a BSOD here also, but it seems that the Diff2 vhd can read about 95% of information of Base.vhd. I tried booting in this instance a few more times with everytime the same result. It boots, but the OS isn't really usable and/or reliable.

    But how does this explain whether or not a parent disk must be ReadOnly? In my test I can (from now on) continue to work in Base or Diff1 (with keeping in mind that you will loose al additional things on Base when you do a merge again from Diff1)

    Not 100% sure if the above is correct, if anyone can shine a light on this ... please :-)

    Sunday, February 01, 2009 2:08 PM
  • Hi Roel, yes I am using the 7000 build too, and it could be that the 7000 bits have some inconsistances between the diskpart, SetupCD and BCD.
    I remember, the manual setup to VHD created the BCD records with "file=" syntax for me too.

    Great, I must have overseen the merge option in diskpart ;) let's destroy another VHD installation :)

    Regarding the parent/differencing disk concept, I was actualy able to boot to all of them until I touched the parent system (updated VGA drivers).

    When I am looking at your test scenario results, i would say we have learned one simply rule:
    "Dont touch any VHD which is parent to some differencing VHD"

    I think the merge is usable only in one diff VHD for one parent VHD scenario, for example when you install some new app or driver and you want to have a possibility to rollback.

    regards

    Lubomir

    PS: I have recreated the diff files and I am able to boot to both of them again
    • Marked as answer by Roel Janssens Monday, February 02, 2009 3:13 PM
    Monday, February 02, 2009 2:41 PM
  • Lubomir Hozak said:

    ... I would say we have learned one simply rule: "Dont touch any VHD which is parent to some differencing VHD"

    And I would add to that, we should RTFM:

    Modification of Parent Hard Disk Image

    After a differencing hard disk is created for a parent hard disk, the parent hard disk should not be modified. Modifying the parent hard disk invalidates the state of the differencing hard disk. To ensure this does not happen, the parent modification date is stored in the differencing hard disk structure.

    Virtual Hard Disk Image Format Specification
    http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc



    • Edited by Roel Janssens Thursday, February 05, 2009 7:25 AM formatting (preview doesn't work nicely)
    Thursday, February 05, 2009 7:24 AM
  • Hi, I am redoing my Windows 7 installation. I rewrote my setup guide too. 
    http://blogs.infosupport.com/ericd/archive/2009/02/05/My-New-Windows-7-Setup-booting-from-VHD-_2800_part-1_2900_.aspx   is the setupguide. the purpose of this install will be: http://blogs.infosupport.com/ericd/archive/2009/02/05/My-Day-today.aspx
    because there are many steps involved there is already more than one part of the install guide.

    enjoy...
    MCT
    Thursday, February 05, 2009 8:05 AM
  • It looks like i have found something weird, can somebody plesase check this. When I boot from DVD and use bcdedit I need to use the file= option to boot from Differencing disk, If i boot from an installed Windows 7 setup and use BCDedit i HAVE to use the vhd= option. Is there somebody who can confirm this please?
    MCT
    Thursday, February 05, 2009 1:08 PM
  • Eric Denekamp said:

    It looks like i have found something weird, can somebody plesase check this. When I boot from DVD and use bcdedit I need to use the file= option to boot from Differencing disk, If i boot from an installed Windows 7 setup and use BCDedit i HAVE to use the vhd= option. Is there somebody who can confirm this please?


    MCT


    Eric,

    I tried it also and I experienced no different behaviour when booten from DVD of from within Windows 7.

    vhd=[C:]       works
    vhd=[locate]   works
    file=[C:]      works
    file=[locate]  error

    I didn't try to also boot up in above testings, but this is the output I got from bcdedit.
    Thursday, February 05, 2009 1:58 PM
  • Eric Denekamp said:

    It looks like i have found something weird, can somebody plesase check this. When I boot from DVD and use bcdedit I need to use the file= option to boot from Differencing disk, If i boot from an installed Windows 7 setup and use BCDedit i HAVE to use the vhd= option. Is there somebody who can confirm this please?


    MCT



    Hi Eric,
    I have already mentioned that, and it could really be that the setup process uses wrong format (file=) for the device and osdevice values while creating or updating the BCD.
    I think the "file=" format should be used for booting from wim files.
    However when you have just one VHD boot entry it seems to work without any problem.

    Lubomir
    Wednesday, February 11, 2009 9:00 PM
  • I'm still a bit confused...getting an error when I try to boot to vhd.  If I have created a VHD, sysprepped on my Windows 2008 R2 server, and then move the file to a Windows Server 2008 R2 server that does not have hardware assisted virtualization can I still create my BCD entry and boot this file?  

     

    Thanks much


    Lee Everest http://www.texastoo.com
    Thursday, August 19, 2010 3:32 PM
  • hi ive same problem it a hacker that plays with our default settings etc microsoft stated to me other day it in my yahoo messenger as cant delete the file etc but lucky i dont use messenger so ive not passed it on i just want kill it as it totally messed up my pc settings plus cant run or download software frm any1 even microsoft . i need to find also my windows32 file as microsoft stated i need re register but ive no disc x

     


    but it might be smwere else in other computers hiding and also ive run anti virus and result clean
    • Edited by diesel2011 Thursday, January 12, 2012 5:44 AM
    Thursday, January 12, 2012 5:42 AM
  • im still learning but MICROSOFT fiew days ago notice i have a hacker THAT IS CHANGING MY SETTINGS ETC EVEN MY PC IS US NOW .        it in my yahoo messanger cant delete remove etc and just want kill it as it messed up my windows32 plus all dll and i canot download software etc. im still on xp service 3 . dont know if that is of any help as i realy am just a basic user                                                      0x80004005 same as most of us
    • Edited by diesel2011 Thursday, January 12, 2012 6:15 AM
    Thursday, January 12, 2012 6:14 AM