Microsoft Hyper-V Server 2012 is a free version of Windows Server 2012 that only supports the Hyper-V role. You can use this to install on bare metal to give you a hyper visor that can support virtualisation. In this article I will be looking at how you prepare an image and configuration file (autounattend.xml) to target a server for a hands off installation.
Resources you will need
- Hyper-V Server 2012 ISO – Click on Free Download in the banner on http://www.microsoft.com/en-us/server-cloud/hyper-v-server/
- The Microsoft USB/DVD download tool (you may have to Bing! it if you can’t access this region of the store) – http://emea.microsoftstore.com/UK/en-GB/Service-Centre/Windows-7-USB-DVD-Download-Tool
- The Windows Assessment and Deployment Kit (ADK) (I have Windows 8 so Bing! the version you need) – http://www.microsoft.com/en-us/download/details.aspx?id=30652
Download the ISO, install the DVD tool but when you come to install the ADK only install the Deployment Tools:
You will need to run the Windows System Image Manager:
First mount the ISO on a local drive or open it in another program to extract the install.wim file from the sources folder. Save this file to your local hard disk. From the File Menu select New Answer File… then choose Yes to Open a new Windows Image:
Select the Windows install.wim Image that you copied from the Sources folder earlier:
Then select yes to create the catalogue file. This will take a few minutes. At this point you could use the USB/DVD download tool to create your bootable USB drive. A 2GB USB Drive will do fine for this.
When the creation of the catalogue file has completed you will need to add a number of configuration options from the Windows Image section in the bottom left of the Windows System Image Manager window to the Answer File. You do this by opening the Components Tree and right-clicking on a Component with the mouse and selecting the appropriate phase to add it to. You will then see the Answer File populate with the Configuration Option that you can edit later. I will details the Configuration Options you need to add to your answer file to enable an unattended install of Windows Hyper-V Server 2012.
Add the following to 1 windowsPE:
Add the following to 4 specialize:
Add the following to 7 oobe System:
Remove any items from the tree that you may have that are not shown above. They will not be needed.
Go back to the top of the Tree and Select amd64_Microsoft-Windows-International-Core-WinPE. For Input Local, SystemLocale, UILanguage, UILanguageFallback and UserLocale enter en-US
Select SetupUILanguage and set UI Language to en-US and WillShowUI to OnError
Select amd64_Microsoft-Windows-Setup, set EnableFirewall to False and EnableNetwork to True
Then select DiskConfiguration right click and select Insert New Disk. Set the DiskID to 0 and set WillWipeDisk to True
Right click on CreatePartitions and select Insert New CreatePartition on this set Order to 1, Size to 100 and Type to Primary
Do the same again but set the Extend to true, Order to 2 and Type to Primary
Move down to ModifyPartitions right click and select Insert New ModifyPartition, set Active to True, Format to NTFS, Label to Boot, Order to 1 and PartitionID to 1
Do the same again but don’t set Active,set Label to System, Order to 2 and PartitionID to 2
Select Image install right click and select Insert New OSImage. Set InstallToAvailablePartition to False and WillShowUI to OnError. Select InstallFrom, right click and select Insert New MetaData. Set the Key to /IMAGE/NAME and set Value to Hyper-V Server 2012 SERVERHYPERCORE. Remove Credentials
Select InstallTo and set DiskID to 0 and PartitionID to 2
Select UserData and set AcceptEula to True, FullName to User and Organization to Company
Select amd64_Microsoft-Windows-Shell-Setup, set ComputerName to HYPER-V-01, set RegisteredOwner to User and set TimeZone to UTC
Select amd64_Microsoft-Windows-TerminalServices-LocalSessionManager and set fDenyTSConnections to False
Select amd64_Microsoft-Windows-TerminalServices-RDP-WinStationExtensions, set SecurityLayer to 1 and UserAuthentication to 0
Select amd64_Microsoft-Windows-UnattendedJoin and then Identification, in this case we are setting to join a Workgroup so set JoinWorkgroup to WORKGROUP
Navigate to amd64_Microsoft-Windows-Shell-Setup and set RegisteredOrganization to Company, RegisteredOwner to User and TimeZone to UTC
Select AdministratorPassword and for Value type in the password you want to use, in clear text. Later WSIM will encrypt the password. Don’t forget it.
From the Tools menu select Validate Answer File and in the message windows verify that No warnings or errors are shown. From the File menu select Save As… and use the filename autounattend.xml to save the file to your local disk. If you are going to boot the system from USB and you are confident that it will work then you can copy the XML file to your USB stick once you have prepared the USB stick using the Microsoft USB/DVD Download tool.
In my next article I will show you how to verify your unattended install in Hyper-V. This is very useful for proving your answer file where it will be used on a headless system.
One thought on “Unattended install of Microsoft Hyper-V Server 2012”
I have done all this (thank you) for R2 and put the file AutoUnattend.xml in the root of the USB (with the install media). but it is not running unattended. It starts windows setup as normal as if AutoUnattend.xml does not exist. I also made sure the image was updated to reflect R2. any ideas? thank you