Issue

Windows may report: 0xc000000e boot error (The boot selection failed because a required device is inaccessible) when a non-sysprepped base image is restored via the Zim development menu (WinPE imaging)

This issue occurs because the Boot Configuration Data (BCD) store cannot locate the Windows partition(s). A sysprepped image has a different BCD setting that allows the Boot Manager to locate the appropriate partitions.

NOTE:
This issue will also occur when using the Restore_Static section of the zim.cfg file to restore a non-sysprepped base image.


Solution

Modify the zim.cfg file to update the BCD store after the image has been restored.

NOTE:
The script sample detailed in this TID is for the Development Menu -> Restore an image option. Please contact ENGL if you require assistance in modifying other sections of a zim.cfg file

Requirements

  • ENGL WinPE 5 imaging environment

  • zim.cfg file

  • Text editor

Procedures


Done
Task
 
1.
Modify the zim.cfg file
 
2.
Test the updated file


  1. Modify the zim.cfg file

    • Open tftp/zimfiles/zim.cfg file in text editor.

    • Update the section with the following lines (shown in green):

      Label:Dev_Restore_Image_Name
      
      ; Launch a Form to enter image name
      Form:Start,"Form_RestoreImageName","Enter image name","_OkCancel^_Ok",Blue
      Form:Item,"Item1",Label,"Image path"
      Form:Item,"Item2",EditBox,"%Restore_Image_Path%",ReadOnly
      Form:Item,"Item3",Label,"Enter image name"
      
      If:Var,Lookup_Image_Type,EQ,"Other"
        Form:Item,"Item4",Browse_File,"%WimPath%","Specify a WIM file","%Images_Path%","wim","open"
      Else:
        Form:Item,"Item4",EditBox,"%Image_Name%"
      End:
      
      Form:Display,"Form_RestoreImageName"
      
      If:Var,_Form,EQ,"_Cancel"
        Menu:Return
      End:
      
      Set:Image_Name,"%_Form_RestoreImageName_Item4%"
      Set:ExtensionCheck,Right("%Image_Name%",4)
      
      If:var,ExtensionCheck,NE,".wim"
        Set:Image_Name,"%Image_Name%.wim"
      End:
      
      File:Run,"net use "%Images_Path%" /user:%Images_Share_Username% %Images_Share_Password%",silent
      
      If:Var,Lookup_Image_Type,EQ,"OS"
        Wim:Apply,"%Images_Path%\%Restore_Image_Path%\%Image_Name%"
        If:EFI,Exist
          ; Copy boot files from the Windows partition to the System partition
          File:Run,"bcdboot %Project_Partition%\Windows"
      End:
      File:Ini,Get,"%_ZimDir%projects.ini","%Lookup_Project%","Base_Image",Base_Image
      
      If:Var,Image_Name,EQ,"%Base_Image%.wim"
        ; Image name matches project 'base image' name therefore we are restoring a sysprepped base image.
      else:
        ; non sysprepped image restored so we need to update the bcd store with the correct paths.
      
        If:Var,Partition_Count,EQ,"1"
          File:Run,"cmd /c bcdedit /set {default} device partition=C: >> %_ZimDir%/zim.log"
          File:Run,"cmd /c bcdedit /set {default} osdevice partition=C: >> %_ZimDir%/zim.log"
          File:Run,"cmd /c bcdedit /set {bootmgr} device partition=C: >> %_ZimDir%/zim.log"
        Else:
          File:Run,"cmd /c bcdedit /set {default} device partition=D: >> %_ZimDir%/zim.log"
          File:Run,"cmd /c bcdedit /set {default} osdevice partition=D: >> %_ZimDir%/zim.log"
          File:Run,"cmd /c bcdedit /set {bootmgr} device partition=C: >> %_ZimDir%/zim.log"
        End:
      End:
      
      ElseIf:Var,Lookup_Image_Type,EQ,"Other"
        Wim:Apply,"%Image_Name%"
      Else:
        Wim:Apply,"%Images_Path%\%Restore_Image_Path%\%Image_Name%","1","%Project_Partition%"
      End:
      
      File:Run,"net use "%Images_Path%" /delete /yes",silent
      
      Menu:Return
    • Save changes to the zim.cfg file 
  2. Test updated files

    • PXE Boot a machine to the ENGL PE imaging environment. 
    • Select Maintenance Menu
    • Select Development Menu
    • Select Restore an image
    • Select Image Type : OS and select appropriate Project from the drop down list 
    • When prompted for the image name enter the appropriate file name 
    • Select OK. The image should now restore successfully 
    • The machine will now deploy successfully. 


If you have any problems or questions about the script or steps in this TID  please contact the ENGL support team