none
Windows Server 2016 - Autounattend.xml - Default disk configuration

    Question

  • Hello,

    Does anyone have an "unattend.xml" (or "autounattend.xml") template for Windows Server 2016 that creates the same MBR disk layout as Windows Setup?

    I'm trying to automate deployment of Windows Server 2016 Standard (Desktop Experience) x64 across a number of servers, but can't seem to match the exact disk layout that Windows Setup creates. My servers only have a single disk.

    Attached is a screenshot of the disk after stepping through Windows Installer. Partitioning and expanding the C:\ disk with an unattend file isn't an issue, but I haven't had any luck matching the "System Reserved" partition, even with the examples on MSDN.

    MSDN link 1.
    MSDN link 2.


    I can provide more details, failed unattend samples if needed.

    Thanks,
    Andrew


    • Edited by Maul Tuesday, February 14, 2017 7:10 PM
    Tuesday, February 14, 2017 7:08 PM

Answers

  • Using default example, for System volume, remove Letter object.

    So it would be like this:

        <ModifyPartitions>
          <!-- System partition -->
          <ModifyPartition wcm:action="add">
            <Order>1</Order> 
            <PartitionID>1</PartitionID> 
            <Label>System</Label> 
            <Format>NTFS</Format> 
            <Active>true</Active> 
          </ModifyPartition>

    • Marked as answer by Maul Thursday, February 23, 2017 9:47 PM
    Friday, February 17, 2017 9:03 PM

All replies

  • Hi,

    >>Does anyone have an "unattend.xml" (or "autounattend.xml") template for Windows Server 2016 that creates the same MBR disk layout as Windows Setup?

    I only found a sample applies to windows server 2012,but there is no official information tells that unattended files have big differences between 2012 and 2016,I think you could take this for your reference:

    Sample: Configure BIOS/MBR-Based Hard Drive Partitions by Using Windows Setup

    https://technet.microsoft.com/en-us/library/hh825701.aspx

    Other REF:Windows Server 2016: Unattended installation

    https://social.technet.microsoft.com/wiki/contents/articles/36609.windows-server-2016-unattended-installation.aspx


    Best Regards
    Cartman
    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 15, 2017 6:09 AM
    Moderator
  • Hi Cartman,

    Thanks for your response. I tested the examples on "Sample: Configure BIOS/MBR-Based Hard Drive Partitions by Using Windows Setup". Here are the results on Server 2016.

    The configuration from "Example: Automatically install the default partition configuration" does not produce an exact match. Instead, it creates a 350 MB "S:\" drive that is visible on the "This PC" layout screen. There appears to be some data written to it, but that data is hidden.



    The configuration from "Example: Automatically install the recommended partition configuration" does not produce an exact match either. Instead, it creates an unlabeled recovery partition, and the 350 MB "S:\" drive that is visible on the "This PC" layout screen. Also note that this example has malformed XML, the third "CreatePartition" block is outside of "CreatePartitions". You also have to massage the "Order" and "PartitionID" XML keys to prevent Windows Setup from erroring out.

    Here is the corrected XML for that example:

    	<DiskConfiguration>
    
    	  <Disk wcm:action="add">
    		<DiskID>0</DiskID> 
    		<WillWipeDisk>true</WillWipeDisk> 
    		<CreatePartitions>
    
    		  <!-- System partition -->
    		  <CreatePartition wcm:action="add">
    			<Order>1</Order> 
    			<Type>Primary</Type> 
    			<Size>350</Size> 
    		  </CreatePartition>
    
    		  <!-- Windows partition -->
    		  <CreatePartition wcm:action="add">
    			<Order>2</Order> 
    			<Type>Primary</Type> 
    			<Size>75000</Size> 
    		  </CreatePartition>
    
    		  <!-- Recovery image partition -->
    		  <CreatePartition wcm:action="add">
    			<Order>3</Order> 
    			<Type>Primary</Type> 
    			<Size>15000</Size> 
    		  </CreatePartition>
    		  
    		</CreatePartitions>
    
    		<ModifyPartitions>
    
    		  <!-- System partition -->
    		  <ModifyPartition wcm:action="add">
    			<Order>1</Order> 
    			<PartitionID>1</PartitionID> 
    			<Label>System</Label> 
    			<Letter>S</Letter> 
    			<Format>NTFS</Format> 
    			<Active>true</Active> 
    		  </ModifyPartition>
    
    		  <!-- Windows partition -->
    		  <ModifyPartition wcm:action="add">
    			<Order>2</Order> 
    			<PartitionID>2</PartitionID> 
    			<Label>Windows</Label> 
    			<Letter>C</Letter> 
    			<Format>NTFS</Format> 
    		  </ModifyPartition>
    
    		  <!-- Recovery image partition -->
    		  <ModifyPartition wcm:action="add">
    			<Order>3</Order> 
    			<PartitionID>3</PartitionID> 
    			<Label>Recovery</Label> 
    			<Format>NTFS</Format> 
    			<TypeID>0x27</TypeID>
    		  </ModifyPartition>
    
    		</ModifyPartitions>
    	  </Disk>
    	  <WillShowUI>OnError</WillShowUI> 
    	</DiskConfiguration>
    
    	<ImageInstall>
    		<OSImage>
    			<InstallTo>
    				<DiskID>0</DiskID>
    				<PartitionID>2</PartitionID>
    			</InstallTo>
    		</OSImage>
    	</ImageInstall>


    I'm unable to test the second example because that doesn't have a "DiskConfiguration" XML structure, and I'm not using HyperV.

    My current workaround is to automate only the disk setup portion of Windows Setup with keyboard strokes then handle the rest of the installation with "Autounattend.xml". That setup is a little sloppy though, getting a matching disk through the "Autounattend.xml" would be ideal (and it would likely benefit others).

    Any other ideas? Would it be possible to forward this to an engineer?

    Best,
    Andrew

    Friday, February 17, 2017 7:01 PM
  • Using default example, for System volume, remove Letter object.

    So it would be like this:

        <ModifyPartitions>
          <!-- System partition -->
          <ModifyPartition wcm:action="add">
            <Order>1</Order> 
            <PartitionID>1</PartitionID> 
            <Label>System</Label> 
            <Format>NTFS</Format> 
            <Active>true</Active> 
          </ModifyPartition>

    • Marked as answer by Maul Thursday, February 23, 2017 9:47 PM
    Friday, February 17, 2017 9:03 PM
  • Hi,

    Does Tripredacus's reply help?

    If there's anything you'd like to know, don't hesitate to ask.


    Best Regards
    Cartman
    Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, February 23, 2017 3:15 AM
    Moderator
  • Hi Tripredacus,

    Thanks for your answer. This is the correct solution. Originally, I was just clearing the contents of the "Letter" object, not removing the object itself. Removing the "Letter" XML object and increasing the "System" partition to 500 produces an almost identical match to Windows Setup.

    The only difference I noticed is that the entire drive appears ~750MB smaller when partitioning through the autounattend.xml versus Windows Setup. This difference is negligible for my use case, so I'm going to consider this solved.

    Here is what the partitions look like with the 350 MB (default example, incorrect match), versus 500MB (correct match).

    And finally, the proper XML config:

    <DiskConfiguration>
    
    			  <Disk wcm:action="add">
    				<DiskID>0</DiskID> 
    				<WillWipeDisk>true</WillWipeDisk> 
    				<CreatePartitions>
    				  <!-- System partition -->
    				  <CreatePartition wcm:action="add">
    					<Order>1</Order> 
    					<Type>Primary</Type> 
    					<Size>500</Size> 
    				  </CreatePartition>
    
    				  <!-- Windows partition -->
    				  <CreatePartition wcm:action="add">
    					<Order>2</Order> 
    					<Type>Primary</Type> 
    					<Extend>true</Extend> 
    				  </CreatePartition>
    				</CreatePartitions>
    
    				<ModifyPartitions>
    				  <!-- System partition -->
    				  <ModifyPartition wcm:action="add">
    					<Order>1</Order> 
    					<PartitionID>1</PartitionID> 
    					<Label>System Reserved</Label> 
    					<Format>NTFS</Format>
    					<Active>true</Active>
    				  </ModifyPartition>
    
    				  <!-- Windows partition -->
    				  <ModifyPartition wcm:action="add">
    					<Order>2</Order> 
    					<PartitionID>2</PartitionID> 
    					<Label>Windows</Label> 
    					<Letter>C</Letter> 
    					<Format>NTFS</Format> 
    				  </ModifyPartition>
    				</ModifyPartitions>
    			  </Disk>
    			  <WillShowUI>OnError</WillShowUI> 
    			</DiskConfiguration>
    
    			<ImageInstall>
    			  <OSImage>
    				<InstallTo>
    				  <DiskID>0</DiskID> 
    				  <PartitionID>2</PartitionID> 
    				</InstallTo>
    			  </OSImage>
    			</ImageInstall>			

    Best,

    Andrew

    Thursday, February 23, 2017 9:47 PM
  • Yes, thank you. Details posted above. This issue is now solved.
    Thursday, February 23, 2017 9:47 PM