Windows cannot parse the answer file's <diskconfiguration> setting

Page 1 of 3 123 LastLast

  1. Posts : 8
    Gnu/Linux Slackware
       #1

    Windows cannot parse the answer file's <diskconfiguration> setting


    I'm trying an unattended windows 10 install using an XML answer file, for now I tried booting a Virtual Machine (both with Virtualbox and libvirt Qemu/KVM) using an official ISO file, edited by adding the attached Autounattend.xml. Target virtual disk is set to SATA and allocated with 30GB of size, it should be enough.

    The install process seems to start right. But after a while it returns the error reported in the above topic title.
    After reading this ms docs page, I can't find any differences between my xml file and the one in the section <DiskConfiguration> of the sample of that page:

    https://docs.microsoft.com/en-us/pre...5702(v=win.10)

    Could you take a look at my attachment and help me to find the issue?
    Thanks a lot in advance!
    Cheers!
    Windows cannot parse the answer file's &lt;diskconfiguration&gt; setting Attached Files
      My Computer


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #2

    Welcome to TenForums!

    Windows didn't like the multi-line comment that the answer file generator created. In your answer file take a look at this section:

    Code:
                <!-- MSR partition does not need to be modified -->
                <!--
    	<ModifyPartition wcm:action="add">
    	<Order>3</Order>
    	<PartitionID>3</PartitionID>
    	</ModifyPartition>
    -->
    Note that the idea was that everything between the "<!--" and "-->" was going to be a comment. Just get rid of those 2 lines so that it looks like this:

    Code:
                <!-- MSR partition does not need to be modified -->
    	<ModifyPartition wcm:action="add">
    	<Order>3</Order>
    	<PartitionID>3</PartitionID>
    	</ModifyPartition>
    That should fix the issue, but I have a couple of other suggested changes:

    The Windows RE partition is sized a bit small by modern standards. I would suggest simply charging the 300 to 500 like this:

    Code:
                <!-- Windows RE Tools partition -->
                <CreatePartition wcm:action="add">
                  <Order>1</Order>
                  <Type>Primary</Type>
                  <Size>500</Size>
                </CreatePartition>
    NOTE: If you manually make those changes, use an editor such as Notepad that does not add any hidden formatting characters to the file. As an alternative, I have made those changes below. You can simply copy and paste the entire contents below. Again, use something like Notepad.

    I tested the modified answer file and was able to install Windows completely unattended with that answer file.

    Finally, I know that you are just using an autogenerated answer file here, but if you are interested in learning more about creating your own, please let me know. I can point you to some excellent tutorials here on TenForums if you want to learn more.

    Hope this helps!

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!--*************************************************
    Windows 10 Answer File Generator
    Created using Windows AFG found at:
    ;http://www.windowsafg.com
    
    Installation Notes
    Location: 
    Notes: Enter your comments here...
    **************************************************-->
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
      <settings pass="windowsPE">
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <SetupUILanguage>
            <UILanguage>it-IT</UILanguage>
          </SetupUILanguage>
          <InputLocale>0410:00000410</InputLocale>
          <SystemLocale>it-IT</SystemLocale>
          <UILanguage>it-IT</UILanguage>
          <UILanguageFallback>it-IT</UILanguageFallback>
          <UserLocale>it-IT</UserLocale>
        </component>
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <DiskConfiguration>
    
            <Disk wcm:action="add">
    
              <DiskID>0</DiskID>
              <WillWipeDisk>true</WillWipeDisk>
    
              <CreatePartitions>
    
                <!-- Windows RE Tools partition -->
                <CreatePartition wcm:action="add">
                  <Order>1</Order>
                  <Type>Primary</Type>
                  <Size>500</Size>
                </CreatePartition>
    
                <!-- System partition (ESP) -->
                <CreatePartition wcm:action="add">
                  <Order>2</Order>
                  <Type>EFI</Type>
                  <Size>100</Size>
                </CreatePartition>
    
                <!-- Microsoft reserved partition (MSR) -->
                <CreatePartition wcm:action="add">
                  <Order>3</Order>
                  <Type>MSR</Type>
                  <Size>128</Size>
                </CreatePartition>
    
                <!-- Windows partition -->
                <CreatePartition wcm:action="add">
                  <Order>4</Order>
                  <Type>Primary</Type>
                  <Extend>true</Extend>
                </CreatePartition>
    
              </CreatePartitions>
    
              <ModifyPartitions>
    
                <!-- Windows RE Tools partition -->
                <ModifyPartition wcm:action="add">
                  <Order>1</Order>
                  <PartitionID>1</PartitionID>
                  <Label>WINRE</Label>
                  <Format>NTFS</Format>
                  <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID>
                </ModifyPartition>
    
                <!-- System partition (ESP) -->
                <ModifyPartition wcm:action="add">
                  <Order>2</Order>
                  <PartitionID>2</PartitionID>
                  <Label>System</Label>
                  <Format>FAT32</Format>
                </ModifyPartition>
    
                <!-- MSR partition does not need to be modified -->
    	<ModifyPartition wcm:action="add">
    	<Order>3</Order>
    	<PartitionID>3</PartitionID>
    	</ModifyPartition>
    
                <!-- Windows partition -->
                <ModifyPartition wcm:action="add">
                  <Order>4</Order>
                  <PartitionID>4</PartitionID>
                  <Label>Windows</Label>
                  <Letter>C</Letter>
                  <Format>NTFS</Format>
                </ModifyPartition>
              </ModifyPartitions>
    
            </Disk>
    
    	<WillShowUI>OnError</WillShowUI>
          </DiskConfiguration>
          <ImageInstall>
            <OSImage>
              <InstallTo>
                <DiskID>0</DiskID>
                <PartitionID>4</PartitionID>
              </InstallTo>
              <InstallToAvailablePartition>false</InstallToAvailablePartition>
              <InstallFrom>
                <Path>install.wim</Path>
                <MetaData>
                  <Key>/IMAGE/INDEX</Key>
                  <Value>5</Value>
                </MetaData>
              </InstallFrom>
            </OSImage>
          </ImageInstall>
          <UserData>
            <ProductKey>
              <!-- Do not uncomment the Key element if you are using trial ISOs -->
              <!-- You must uncomment the Key element (and optionally insert your own key) if you are using retail or volume license ISOs -->
              <Key/>
              <WillShowUI>Never</WillShowUI>
            </ProductKey>
            <AcceptEula>true</AcceptEula>
            <FullName>root</FullName>
            <Organization/>
          </UserData>
        </component>
      </settings>
      <settings pass="offlineServicing">
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <EnableLUA>false</EnableLUA>
        </component>
      </settings>
      <settings pass="generalize">
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <SkipRearm>1</SkipRearm>
        </component>
      </settings>
      <settings pass="specialize">
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <InputLocale>0410:00000410</InputLocale>
          <SystemLocale>it-IT</SystemLocale>
          <UILanguage>it-IT</UILanguage>
          <UILanguageFallback>it-IT</UILanguageFallback>
          <UserLocale>it-IT</UserLocale>
        </component>
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <SkipAutoActivation>true</SkipAutoActivation>
        </component>
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-SQMApi" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <CEIPEnabled>0</CEIPEnabled>
        </component>
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <ComputerName>pc</ComputerName>
          <ProductKey>W269N-WFGWX-YVC9B-4J6C9-T83GX</ProductKey>
        </component>
      </settings>
      <settings pass="oobeSystem">
        <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <AutoLogon>
            <Password>
              <Value/>
              <PlainText>true</PlainText>
            </Password>
            <Enabled>true</Enabled>
            <Username>root</Username>
          </AutoLogon>
          <OOBE>
            <HideEULAPage>true</HideEULAPage>
            <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
            <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
            <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
            <NetworkLocation>Home</NetworkLocation>
            <SkipUserOOBE>true</SkipUserOOBE>
            <SkipMachineOOBE>true</SkipMachineOOBE>
            <ProtectYourPC>3</ProtectYourPC>
          </OOBE>
          <UserAccounts>
            <LocalAccounts>
              <LocalAccount wcm:action="add">
                <Password>
                  <Value/>
                  <PlainText>true</PlainText>
                </Password>
                <Description/>
                <DisplayName>root</DisplayName>
                <Group>Administrators</Group>
                <Name>root</Name>
              </LocalAccount>
            </LocalAccounts>
          </UserAccounts>
          <RegisteredOrganization/>
          <RegisteredOwner>root</RegisteredOwner>
          <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
          <FirstLogonCommands>
            <SynchronousCommand wcm:action="add">
              <Description>Control Panel View</Description>
              <Order>1</Order>
              <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f</CommandLine>
              <RequiresUserInput>true</RequiresUserInput>
            </SynchronousCommand>
            <SynchronousCommand wcm:action="add">
              <Order>2</Order>
              <Description>Control Panel Icon Size</Description>
              <RequiresUserInput>false</RequiresUserInput>
              <CommandLine>reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v AllItemsIconView /t REG_DWORD /d 1 /f</CommandLine>
            </SynchronousCommand>
            <SynchronousCommand wcm:action="add">
              <Order>3</Order>
              <RequiresUserInput>false</RequiresUserInput>
              <CommandLine>cmd /C wmic useraccount where name="root" set PasswordExpires=false</CommandLine>
              <Description>Password Never Expires</Description>
            </SynchronousCommand>
          </FirstLogonCommands>
          <TimeZone>W. Europe Standard Time</TimeZone>
        </component>
      </settings>
    </unattend>
      My Computers


  3. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #3

    Hello @hsehestedt,

    hsehestedt said:
    If you are interested in learning more about creating your own, please let me know. I can point you to some excellent tutorials here on TenForums if you want to learn more.
    I would be interested please!
      My Computer


  4. Posts : 4,187
    Windows 11 Pro, 22H2
       #4

    Paul,

    One of my all time favorite tutorials from Kari:

    Create media for automated unattended install of Windows 10

    This tutorial is geared towards creating a reference system and completely customizing it by modifying preferences, installing apps, etc. and making an image, then using an answer file to automate installation of that image

    If you simply want to create an answer file to completely install a fresh copy of windows without all those customizations or the need for creating a reference system, do this:

    Follow the tutorial up to and including step 3.18. In the early portion of the tutorial, Kari references a reference system. Simply ignore those references. Jump to section 4 and follow the steps through and including 4.8 but note these exceptions:

    1) DO NOT start a new answer file. Keep adding the items listed in this section to the answer file that you were already configuring in section 3.
    2) In step 4.3, perform all the actions noted BUT DO NOT SET the option called "CopyProfile".
    3) In step 4.4, one of the optional componets that you can set is a cutom logo. Note that if you are not creating a reference system, you will need to copy the logo to C:\Windows\System32 manually after Windows is installed.
    4) Once you have completed step 4.8, jump back to step 3.19 and complete the steps to the end of section 3.

    You now have a complete working autounattend.xml answer file. Create your Windows media with this file in the root (let me know if you need instructions). If you boot from that media, Windows will install 100% automatically without need for any user interaction.

    CAUTION! Label your media!! If you boot from this accidentally, it will wioe out your HD and start installing a Windows without ever prompting you. Yes, you have to press a key to boot from this media, but if you forget that you have an automated installation, then bad things will happen!

    More tutorials:

    This next one is another great tutorial from Kari. This one is like a "quick start" where he provides a pre-built answer file and all you need do is modify a few items:

    Apply unattended answer file to Windows 10 install media

    That should be enough to get you started, and I'm hesitating in dropping the really big stuff on you, but if you want something really comprehensive and in depth, let me know. This stuff isn't for the faint of heart .
      My Computers


  5. Posts : 8
    Gnu/Linux Slackware
    Thread Starter
       #5

    Here I found a good tutorial to create answer file by using various windows tools:

    Create media for automated unattended install of Windows 10

    But I'm experimenting by working from a linux host environment and test the installation in a virtual machine. So I can't use that ordinary way to accomplish this job.

    I tried to cut away the multi-lines comment, recreate ISO image and now it seems to work or at least it has reach the reboot fase at now. Let's see if it go on to the end of process...

    Here is a diff between my last attempt and your suggested example: I left 300 MB for the RE tool, just to find what exactly was the point that caused the issue.
    Code:
                  <Size>500</Size>                                |               <Size>300</Size>
            <ModifyPartition wcm:action="add">                    |             <ModifyPartition wcm:action="add">
            <Order>3</Order>                                      |               <Order>3</Order>
            <PartitionID>3</PartitionID>                          |               <PartitionID>3</PartitionID>
            </ModifyPartition>                                    |             </ModifyPartition>
            <WillShowUI>OnError</WillShowUI>                      |         <WillShowUI>OnError</WillShowUI>
    The multi-line comment was added by me to the auto-generated XML file:
    there was an other error, so I tried to comment that part.

    In the original XML file I've also labeled as "OS" the target partition, the one that now I renamed as "Windows".
    Maybe that name has to be set exactly to "Windows"?
    I don't know, it seems strange I think, even if it could be eventually.

    Anyway rule to remember:

    No multiline comment in Autounattend.xml file!

    Despite it is allowed by XML standard, seems not recognized by Windows install procedure.

    That's all for now.
    I'll report how the process will be ended.
      My Computer


  6. Posts : 4,187
    Windows 11 Pro, 22H2
       #6

    joeten,

    LOL, I must have posted mere seconds before your last post. Take a look at the last link I posted there.

    That tutorial, from Kari, has a pre-built answer file that would be a perfect starting point for you along with some instructions on what you can manually modify. Since you are not using the MS tools to create the answer file, I think that this would be an an excellent resource.

    EDIT: The name does not specifically need to be "Windows". Just so long as the important details such as size, disk number, what partition to install to, etc. are correct. The label is more for user readability.
      My Computers


  7. Posts : 8
    Gnu/Linux Slackware
    Thread Starter
       #7

    Yes, excellent post timing!

    Thanks a lot for all your links and suggests, I confirm a proper working install process. It has completed and produced a working system installed on a virtual hard drive...
    So, test completed!

    PS.
    It's not really in topic on this forum anyway I'll report a bash script I used to re-make the ISO file (make_winiso.sh):
    Code:
    inputdir=$1
    outputiso=$2
    label="UEFI_BIOS_BOOT"
    biosboot=boot/etfsboot.com
    efiboot=efi/microsoft/boot/efisys.bin
    
    mkisofs \
            -iso-level 4 \
            -l -R -UDF -D \
            -volid $label \
            -b $biosboot \
            -no-emul-boot \
            -boot-load-size 8 \
            -hide boot.catalog \
            -eltorito-alt-boot \
            -eltorito-platform efi \
            -no-emul-boot -b $efiboot \
            -o $outputiso \
            $inputdir
    Code:
    mount -o loop Win10_20H2_v2_Italian_x64.iso temp-mountdir
    cp -rT temp-mountdir Win-ISO-rootdir
    cp Autounattend.xml Win-ISO-rootdir
    make-winiso.sh Win-ISO-rootdir Win10_20H2_v2_italian_x64_unattend.iso
      My Computer


  8. Posts : 4,187
    Windows 11 Pro, 22H2
       #8

    joeten said:
    It's not really in topic on this forum anyway I'll report a bash script I used to re-make the ISO file (make_winiso.sh):
    Actually, that's some very helpful information. Thanks for sharing it!
      My Computers


  9. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #9

    Hello @hsehestedt,

    Thank you for taking the time to provide that information, it is very much appreciated. I will be printing that out to keep.

    It is something that I have on my list of things to do at some stage, out of curiosity more than anything.

    I have used custom ISO installations for years [ Win Vista, Win 7, Win 10. I can't remember the last Standard installation I did ], where I basically remove everything I am not going to use from the install.wim, and then create the installation media [ USB ]. My current Win 10 was about 3GB compiled and less than 8GB installed. I then run a master .bat, .ps1, and .reg file that customises it further. For my purposes, it is easier to do it this way rather than in the creation of the installation media because if I change my mind, I DON'T have to create another installation ISO and then add my programs and run my master files.

    I then create a System Image with AOMEI Backupper, install all my programs [ not that many really ], and then create another System Image.

    If I have any problems, I use WinXPE [ all the Repair and Diagnostic tools and software etc are on there rather than on the OS ] to rectify them.

    It is easy, quick, and does what it says on the tin, so to speak.

    Thanks again.
      My Computer


  10. Posts : 4,187
    Windows 11 Pro, 22H2
       #10

    Very cool, Paul.

    Yeah, that's pretty much the route I go. I do an unattended install of a clean copy of Windows.

    Adding drivers is easy, all I need to do is run a single command and ALL drivers for my system get installed.

    All that is left then is a few apps and I'm good to go .
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:02.
Find Us




Windows 10 Forums