Skip to content

Instantly share code, notes, and snippets.

@schakko
Created April 24, 2015 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schakko/d5df24a2aab89e5e7ed0 to your computer and use it in GitHub Desktop.
Save schakko/d5df24a2aab89e5e7ed0 to your computer and use it in GitHub Desktop.
Hard disk configuration for installing Windows 2012 R2 in VirtualBox without hitting the 0x80042565 error
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<!-- only relevant information to install Windows 2012 R2 in VirtualBox without hitting 0x80042565 error -->
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<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 is important. By default, Windows 2012 R2 uses a partition size of 350 MByte and *not* 300 MByte as shown in the examples -->
<Size>350</Size>
</CreatePartition>
<!-- Windows partition -->
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<!-- Use the the available space of the hard disk -->
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<!-- Windows RE Tools partition. This partition is required and must have a size of at least 350 MByte. -->
<!-- partitions smaller than 350 MByte results in an 0x80042565 error -->
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>WinRE</Label>
<Format>NTFS</Format>
<!-- <TypeID>de94bba4-06d1-4d40-a16a-bfd50179d6ac</TypeID> -->
</ModifyPartition>
<!-- Windows partition -->
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Active>true</Active>
<Label>Windows</Label>
<Letter>C</Letter>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/INDEX</Key>
<!-- Extract .iso to get the index or name from install.wim -->
<!-- Powershell: dism /get-wiminfo /wimfile:install.wim -->
<!-- 2 = Windows Server 2012 R2 SERVERSTANDARD -->
<Value>2</Value>
</MetaData>
</InstallFrom>
<WillShowUI>OnError</WillShowUI>
<!-- using "true" does not work b/c Windows tries to install to the WinRE partition -->
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>true</AcceptEula>
</UserData>
</component>
</settings>
</unattend>
@yanzixiang
Copy link

CAN U EXPLAIN HOW TO USE THIS FILE ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment