locked
Restoring WIN 7 Desktop using DISM. RRS feed

  • Question

  • I have built a Windows 7 Pro box and configured it like I need it. I have captured the image with no problem but when I restore it to another PC (exactly the same hardware) I get 2 copies of Windows to boot to.  When I run BCDEDIT it shows 2 copies of the OS.  If I run MSconfig it does the same.  If I boot to Last Known Good Configuration it boots fine but the "ghost" OS still shows up in MSconfig or BCDEDIT.  How can I make this go away?  This image will be put on many systems and I can' have the "ghost" OS showing up.
    Wednesday, July 6, 2016 7:57 PM

All replies

  • Hello Stan,

    Can you please elaborate on how you are capturing and restoring the image? Summarize your process. Are you using MDT to capture the image using the sysprep and capture task sequence, for example, and then using DISM manually to extract the wim onto the source hard drive?

    Regards,

    Dlofstedt

    Wednesday, July 6, 2016 8:26 PM
  • The original machine was built and then sysprepped and then captured using DISM.  Command was: DISM /capture-image /imagefile:Z:\Images\%1.wim /capturedir:S:\ /name:"Revolution Image".  On the target machine the command was:

    DiskPart -s FormatHardDrive.s

    DISM /apply-image /imagefile:Z:\Images\%1.wim /index:1 /applydir:C:\

    bcdboot C:\windows

    Wednesday, July 6, 2016 8:32 PM
  • So you didn't use MDT?

    Many questions such as where do I find logs and what logs are interesting are found in: MDT TechNet Forum - FAQ & Getting Started Guide Please take the time to read it. Also if you don't post logs your problem won't be easily solved.

    Wednesday, July 6, 2016 8:40 PM
  • Alrighty then, here is the log. DISM worked fine capturing and restoring the image as far as I can tell. My only issue is the "ghost" OS.

    2016-07-06 15:50:50, Info                  DISM   PID=2212 Scratch directory set to 'C:\Users\REVSER~1\AppData\Local\Temp\'. - CDISMManager::put_ScratchDir
    2016-07-06 15:50:50, Info                  DISM   PID=2212 Successfully loaded the ImageSession at "C:\windows\System32\Dism" - CDISMManager::LoadImageSession
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Failed to get and initialize the PE Provider.  Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM Manager: PID=2212 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE:
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE: <----- Starting Dism.exe session ----->
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE:
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
    2016-07-06 15:50:50, Error                 DISM   DISM.EXE: Failed validating command line: "C:\windows\system32\dism.exe" log
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE:
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE: <----- Ending Dism.exe session ----->
    2016-07-06 15:50:50, Info                  DISM   DISM.EXE:
    2016-07-06 15:50:50, Info                  DISM   DISM Image Session: PID=2212 Disconnecting the provider store - CDISMImageSession::Final_OnDisconnect
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Found the OSServices.  Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
    2016-07-06 15:50:50, Info                  DISM   DISM Provider Store: PID=2212 Releasing the local reference to DISMLogger.  Stop logging. - CDISMProviderStore::Internal_DisconnectProvider
    2016-07-06 15:51:00, Info                  DISM   PID=1692 Scratch directory set to 'C:\Users\REVSER~1\AppData\Local\Temp\'. - CDISMManager::put_ScratchDir
    2016-07-06 15:51:00, Info                  DISM   PID=1692 Successfully loaded the ImageSession at "C:\windows\System32\Dism" - CDISMManager::LoadImageSession
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Failed to get and initialize the PE Provider.  Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM Manager: PID=1692 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Provider has previously been initialized.  Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE:
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE: <----- Starting Dism.exe session ----->
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE:
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
    2016-07-06 15:51:00, Error                 DISM   DISM.EXE: Failed validating command line: "C:\windows\system32\dism.exe" logs
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE:
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE: <----- Ending Dism.exe session ----->
    2016-07-06 15:51:00, Info                  DISM   DISM.EXE:
    2016-07-06 15:51:00, Info                  DISM   DISM Image Session: PID=1692 Disconnecting the provider store - CDISMImageSession::Final_OnDisconnect
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Found the OSServices.  Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
    2016-07-06 15:51:00, Info                  DISM   DISM Provider Store: PID=1692 Releasing the local reference to DISMLogger.  Stop logging. - CDISMProviderStore::Internal_DisconnectProvider

    Wednesday, July 6, 2016 8:59 PM
  • What you are doing is making this more work than necessary and not really MDT.  You can do similar stuff with MDT that is easy and for the most part just works but, this isn't it (if this is how you want to do things however you will need to as for support on the specific OS's forum.

    http://deploymentresearch.com/Research/Post/357/Building-reference-images-like-a-boss


    Many questions such as where do I find logs and what logs are interesting are found in: MDT TechNet Forum - FAQ & Getting Started Guide Please take the time to read it. Also if you don't post logs your problem won't be easily solved.


    • Edited by Ty Glander Wednesday, July 6, 2016 9:53 PM
    Wednesday, July 6, 2016 9:52 PM
  • We are missing some other steps here in the process that could explain why the there are multiple entries present in the BCD.

    * For example, if you are running on a UEFI machine, there could be left over entries in NVRam.

    * Additionally, if you are only creating one partition (which you don't mention), then there could be a left over BCD file on the existing partition. Most OS installations will create a BOot and a System (hidden) partition, so there will be no left over stuff.

    finally, what are the contents of the bcd file before/after bcdboot.exe ?
    bcdedit /enum all /v

    Did BCDBoot.exe add two entries, or was there one already there.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Saturday, July 9, 2016 9:56 PM