The same set of instructions would also work for Windows 8 as well, but you will need to use the Windows 8 install.wim image, and also pay attention to whether you want to automate a 32-bit or 64-bit installation. The autounattend.xml can contain configuration data for both, so only one xml file is needed. If you want to download a pre-configured autounattend.xml file, you can find it here on my Skydrive folder.
1. Download the Windows ADK (Assessment and Deployment Kit) from this link. Never mind that it says Windows 8, as it will work with Windows Server 2012 since they are the same code base.
2. Start the installation process and after a long download select the two options below (Deployment Tools and Windows Preinstallation Environment (Windows PE)). WinPE is technically optional, but in case you need it in the future, I'd install it anyway.
3. After the installation completes go to the Start Menu and select Windows Kits > Windows ADK > Windows System Image Manager.
4. Mount the ISO image of Windows Server 2012, go to the sources directory and copy install.wim to a local drive, such as D.
5. From the File menu click on Select Windows Image, find the install.wim you copied, then select the edition that you want to build an answer file for. I selected SERVERSTANDARD.
6. Next it will complain that a catalog cannot be found, so it will build one for you, taking a few minutes. After the catalog is built, from the file menu select New Answer File.7. Scroll through the Components pane and select amd64_Microsoft-Windows-International-Core-WinPE-_6.2.9200.0_neutral, as shown below, right click, and add to Pass 1.
8. In the Answer File pane click on the component, and fill in the language settings as appropriate. In this case it is configured for US English. You can find a list of the codes here. You also need to configure the SetupUILanguage too.
10. In the Answer File pane right click DiskConfiguration and select Insert New Disk. Right click on CreatePartitions and select Insert New CreatePartition. Configure the partition as shown below. This will create a 100MB primary boot partition. Note: The default in 2008 R2 was 100MB, but in 2012 this is now 350MB. I would suggest using 350MB instead of the 100MB in the screenshot.
11. Create a second partition, but this time set Extend to true, and don't configure a size. This will use the remainder of the disk size.
12. In the Answer File pane click on Disk and change the ID to 0 and WillWipeDisk to true.
14. Add a second ModifyPartitions and configure as shown below:
15. Drill down to the OSImage option and configure as shown below:
16. Right click InstallFrom and select Insert New Metadata. Configure the metadata as shown below. To determine the proper label just think back to when you opened the Windows image (step 5) and enter the image name exactly as it is listed.
17. Configure the InstallTo and use DiskID 0 and PartitionID 2.
18. Configure the UserData options as shown below.
19. Configure the UserData\ProductKey option. The key you use will vary depending on how you are going to activate it (KMS or MAK). You should use the GVLK (generic volume license key) that Microsoft publishes here if you use a KMS server, or your MAK key.
20. Add the amd64_Microsoft-Windows-Shell-Setup_6.2.9200.0_neutral component to Pass 4 specialize.
21. In the Answer File pane click on amd64_Microsoft-Windows-Shell-Setup_6.2.9200.0_neutral and configure the highlighted items below (use the same key as before). You can change the computer name, or leave it blank and it will create a random name upon installation. For a list of timezone values, click here.
22. Add the amd64_Microsoft-Windows-Shell-Setup_6.2.9200.0_neutral component to Pass 7 oobesystem. In the Answer File pane click on amd64_Microsoft-Windows-Shell-Setup_6.2.9200.0_neutral and configure the highlighted items below.
23. Normally I configure autologon for a count of 2, so my image build process goes quicker and in case I forget the administrator password I configured in the answer file I can reset it during the first two reboots. You will also need to configure the password. Enter a password, and when the answer file is written it will be encrypted.
24. Under UserAccounts, configure the AdministratorPassword with the same password you entered for the AutoLogon information.
25. Save the file as autounattend.xml and verify that no errors are shown in the validation pane. You will see a lot of warnings, but that is normal.
26. Open the Windows Server 2012 ISO image in an ISO editor, like UltraISO. Add the autounattend.xml file to the ROOT of the ISO image. Save the ISO, and then configure a VM or physical server to boot from it and verify that there are no prompts or errors during the installation process. Note that the disk configuration and data will be wiped during the installation process.



















Thanks, great post for a newbie on this like me ;)
ReplyDeleteFinally a great guide on how to do Windows 2012 unattended installs! Thank you!
ReplyDeleteHmmmm... when I boot to my newly created .iso, I get an error message "No images are available." Any clue to where I might be making my mistake? Great writeup by the way!!
ReplyDeleteAnonymous! Sounds like in step 16 you didn't enter exactly the name of the "image" you wanted to install. Double check your spelling.
ReplyDeleteAdding RDP Access for Headless server install would be a great addition.
ReplyDeletehmmm... my W2012 server boots up, but stops on the Settings: Country/Region page waiting for me to press 'next'. Any way to skip this page? Thanks Derek!
ReplyDeleteYes, a properly configured file will not prompt for country/region. Double check all the settings.
ReplyDeleteI'll check the settings. I downloaded the autounattend.xml you have above and noticed the same issue. Thanks again Derek!
DeleteOdd..works for me
ReplyDeleteDerek, you were right (again!). When I use the directions/file you posted above, it works.
DeleteWhen installing Windows Server 2012 on VMware ESXi, virtual EFI firmware appears to be a requirement. In place of steps 9 - 14 and 17 above, which are for BIOS firmware, see "Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows Setup" at http://technet.microsoft.com/en-us/library/hh825702.aspx. I used the "Default UEFI/GTP drive partitions" successfully on ESXi 5.0 U1 (821926). Thanks. Jeff.
ReplyDeleteJeffry, Windows Server 2012 and Windows 8 do NOT require UEFI Firmware for installation on ESXi or Workstation. They install just fine using 'traditional' MBR means. I actually haven't tried to install WS2012 in EFI mode, as I don't think that adds any value for a virtual environment. For a physical server it could, where you can leverage secure boot which needs UEFI.
DeleteI'm sure you're right. I didn't test BIOS/MBR but was successful with EFI/GPT using the above-referenced partitioning scheme. The VMware KB article "Windows 8 Release Preview and Windows Server 2012 Release Candidate fail when starting for the first time after the installation" at http://kb.vmware.com/kb/2021887 and referenced by the guest OS compatibility guide alludes to the use of EFI firmware. Jeff.
DeleteJeffry,
DeleteWith the RTM versions of 2012/Win8 and the latest ESXi 5.0 build, there are no hang/installation issues that I'm aware of. Beta versions with old ESXi hosts did have issues.
ESXi 5.0 build 821896 works like a charm.
DeleteThe hang issue I found with ESX 5.0 b821926 and Windows Server 2012 RTM was with the use of a VMXNET3 NIC. While this is said in the compatibility guide to be supported, KB 2006859 states that it is not, and recommends the E1000E as a workaround. My testing confirms this. Anyway I imagine that many of these kinks are worked out in ESX 5.1, which I will be able to test once a compatible version of View is available.
ReplyDeleteI've only used the VMXNET3 NIC, and haven't had any issues. I wrote an article on how to inject those drivers, and I've done about 20 installs with no issues. http://derek858.blogspot.com/2012/10/inject-vsphere-drivers-into-windows.html
DeleteThanks. I'll give that a try with the VMXNET3 and PVSCSI drivers. I had previously added them to my WinPE image, but not to the Windows Server 2012 install.wim.
DeleteUsing the above info from 10/21, confirmed that Windows Server 2012 RTM Datacenter Core installs successfully on ESXi 5.0 b821926 with EFI firmware, GPT disk, pvscsi disk controller, and vmxnet3 NIC.
ReplyDeleteHi! we tried to follow your guide but in USB(UFD). but we are stuck on "no image are available". we already followed the step 5&16. and even used your answerfile but still the same.
ReplyDeleteI would execute step #5 and verify the exact image names in your ISO.
DeleteI have not had any luck with Win8 installation. It stops at "Windows cannot parse the unattend answer file's DiskConfiguration setting. I think I have it correct.
ReplyDeleteThanks in advance.....Joe
I am having the same issue. I have used Derek's XML as a basis, plus created new XML files.
DeleteNeal
I've seen this happen when the mass storage controller is not recognized by Windows. I would use the deployment tools GUI to validate the XML file and see if it comes up with any errors.
Deletehello, does anybody know a way to prepare a unattended.xml file for server 2012 that prompts for the computer name? i´m preparing a vm image for deployment and i only get the windows default computername.
ReplyDeleteAccording to this (http://technet.microsoft.com/en-us/library/ff715676.aspx), "If ComputerName is missing, you must enter a computer name during OOBE.". To me, this sounds like you will be prompted. You will need to make sure the entry in the XML file is blanked out with no spaces in the xml code.
DeleteNeal
If you are using VMware vCenter, it can automatically configure the Windows OS name to match the VM name, using the customization process.
DeleteSearching on the internet for a windows 8 sysprep unattend tutorial i found this page. Since windows server 2012 and windows 8 share the same base can this unattend also be used with windows 8?
ReplyDeleteYes, for the most part it will work with Windows 8. You will of course need to modify the Windows image name for the specific Windows 8 edition you are installing.
DeleteAm I an idiot? I downloaded 2012 standard ISO from Microsoft, mounted the ISO and cannot find install.wim anywhere on the disk? Any help here?
ReplyDelete@anonymous: It's there! :)
ReplyDeleteSorry about last comment, somehow the WRONG ISO got mounted and I wasn't even looking at the 2012 ISO! I mounted the correct one and found the sources dir.
ReplyDeleteOk I've made it all the way to the final step, I'm trying to find a freeware that allows adding a file to an existing ISO. Any suggestions? I've already been through a bunch of stuff and it either isn't obvious how to do it, or they want you to buy a full version (like ultraISO).
ReplyDelete@anonymous: I'm pretty sure DISM has a command to build an ISO. But I haven't used it to know all the switches.
ReplyDeleteI used free WinCDemu to mount the original ISO, copied the files off to my desktop, copied the autounattend.xml file into the root, then created an ISO that included the xml file with the free trial version of AVS Disc Creator. It seems to have worked, will upload and test on a VM shortly! Thanks for this guide though, it cuts right to the chase, I wish more were this clear and to the point.
DeleteI had to purchase ultraISO (was wasting too much time) to make the ISO bootable with the addition of the unattend xml file created. Tested today and windows 2012 deployed from the ISO mounted to VM without any interaction from me at all. GREAT Blog!
ReplyDeleteYou can actually do this with Windows 7 natively. Just drag and drop your file onto the DVD and burn it. Worked for me.
ReplyDeleteOne Caveat I ran into. This article assumes that there are no existing partitions on the disk, the disk partition part will fail if you already have partitions on the disk that had the former OS on it, you need to blow away the partitions using diskpart which makes sense.
I also didn't need to create the primary 350 MB partition...
All around great article.
Anyone Know how to get this answer file to work in Windows Deployment Server with The boot.wim, install.wim
ReplyDeleteI've followed Microsofts Instructions but it doesn't seem to want to work, still have to fill in the blanks if you know what I mean.
Hello Derek,
ReplyDeleteI am new to the deployment game and am looking for some ideas to get me up and running. I found your post to be extremely helpful in building an answer file.
What types of things do you include in your unattend_config.ps1? Also, do each of your "firstlogoncommands" in step 7 happen after a reboot (that is driven by how many reboots you specify in "autologon")? Any help would be greatly appreciated.
Best,
Jeff
How would I have it be a domain controller and specify the new domain name. I need the domain to be a .com NOT a .local to work with an SSL certificate. Server 2012 forces the .local except through an answer file.
ReplyDeleteHad so many issues trying to get Windows deployment services running on windows 2012. Not sure if this helps. Its a collection of info from different sites, and my playing about.
ReplyDelete- For testing, I chose the "Respond to all client computers (known and unknown). I guess as the clients were not then _authorised_ - I had to turn on a GPO option, to allow unauthenticated RPC connections. So from 'group policy management', edit the 'default domain policy'/Administrative templates'/system/Remote procedure Call/restrict unauthenticated RPC clients - ENABLE this policy BUT choose 'NONE'. I rebooted the dc and wds server, then checked resultant set of policy, to ensure the change took affect.
- I absolutely could not get an unattended file working from clicking the image and choosing the option 'Allow image to install in unattended mode', I got it working by choosing the option under the main server name, under tab 'Client', choosing the x64 - I dont know if the image option had the name wrong, it certainly renamed it to Imageunattend.xml, where as the other server option, left it at unattend.xml - maybe a bug.
- I had issues with choosing the language en-us vs en-gb, even after changing everything back to en-us - it wouldn't have it, I had to dism mount the install.wim - re-add the en-us back over the top, then it moved on while building, strange.. here are the commands I used.
first mount
dism /mount-wim /wimfile:c:\temp\install.wim /index:1 /mountdir:c:\test\offline
(where install.wim is the location of your image..you need to first create the mountdir..
then:
dism /image:c:\test\offline /Set-AllInt:en-us
(I didnt even think you could remove the en-us but something happened to it..)
then:
dism /unmount-wim /mountdir:c:\test\offline /commit
then copy your file back to the source area.
- Kept getting a prompt for language settings, finally worked out its to do with the WDS connection credentials, if you get the credentials correct, then it moves on..i.e. using WSIM add:
amd64_Microsoft-Windows-Setup_neutral add to 1
Make sure you ADD the 'WindowsDeploymentServices' section, it didnt seem to copy it over to pass1, I had to add it manually - also I had to add the 'Image selection, and complete that..although I only had a single image I was testing with and therefore didnt see why it would prompt for a select os list, when theres only one Os..
- troubleshooting, press F10 for cmd prompt, the log file is located in c:\windows\panther its called setupact.log
Thanks! very usefull!
ReplyDeleteFirst I would like to say Thank You !!.. question, in the xml file there are two script references, listed in the FirstLogonCommands section which I'm not able to locate... thoughts ?
ReplyDeletecmd.exe /c powershell.exe "c:\Windows\setup\scripts\unattend_config.ps1" > c:\Windows\setup\scripts\unattend_config.log
cmd.exe /c c:\windows\setup\scripts\unattend_software.cmd
Thanks in advance
Those scripts are custom scripts for my environment. They are not required for an unattended installation.
DeleteI am super excited to get going with this, but I'm having a problem editing the properties. I can't type anything in the boxes. I ran it as Administrator as well. Any thoughts that you could share would be much appreciated.
ReplyDeleteThank you!!
Jenn
Hi Jenn, I had this problem also, Read step 6 VERY carefully and do EXACTLY as it says, in particular read the last 8 words.
ReplyDeleteGareth
Hi Derek, I am having a small (massive) problem. Have followed the above, however when I boot up - press a key to boot from disk - it loads files and then starts from scratch again.
ReplyDeleteany thoughts?
Yes, this is a fully unattended installation so if you boot from the ISO for any reason and press a key to continue then Windows will wipe the current disk partitions and re-install. That's by design.
DeleteIf you wish to add a manual step to the install process to stop the automatic re-formatting, then you can remove all of the disk partitioning information and the "installto" keys. You will then get prompted to partition the disk...and it won't be fully unattended.
This comment has been removed by the author.
ReplyDeleteHi,
ReplyDeleteWe are trying to deploy "SERVERDATACENTER" instead of "CENTERSTANDARD" in your "Select an image" step. After the autounattend.xml is created and used with "setup /unattend" option, we ran into an issue with which we were given another "Select an image" windows during the setup but instead of one out of four selections, only "SERVERDATACENTERCORE" and "SERVERDATACENTER" were given. And this makes the whole "unattend" setup, not very "unattend" at all. Does any any ran into the same issue and know how to work around it ?
Thanks,
SWE