Windows Server 2012 Unattended Installation

One of the common tasks that you may do on a regular basis is installing Windows Server 2012 and you want to automate it as much as possible. Using similar tools to those used with Windows Server 2008 R2, you can create an autounattend.xml file that you inject into the Windows Server 2012 installation ISO for a hands-free install.

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.
9. Configuring the disk partitions is tedious, but required. To do that, find amd64_Microsoft-Windows-Setup_6.2.9200.0_neutral and add it to Pass 1 as well.
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.
13. Right click on ModifyPartition and select Insert New ModifyPartition. Configure the partition as shown below.
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 UserDataProductKey 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  1. Hmmmm… 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!!

    • Sorry for my bad english, i'm Chinese.
      I get an error message "No images are available." too.

      Windows Server 2012 ISO:





  2. hmmm… 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!

    • I’ll check the settings. I downloaded the autounattend.xml you have above and noticed the same issue. Thanks again Derek!

  3. The 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.

  4. Using 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.

  5. Hi! 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.

  6. I 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.

    Thanks in advance…..Joe

  7. hello, 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.

  8. Searching 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?

  9. Am 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?

  10. Sorry 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.

  11. Ok 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).

    • I 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.

  12. I 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!

  13. You can actually do this with Windows 7 natively. Just drag and drop your file onto the DVD and burn it. Worked for me.

    One 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.

  14. Anyone Know how to get this answer file to work in Windows Deployment Server with The boot.wim, install.wim
    I’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.

  15. Hello Derek,
    I 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.

  16. 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.

  17. Had 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.

    - 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 need to first create the mountdir..
    dism /image:c:\test\offline /Set-AllInt:en-us
    (I didnt even think you could remove the en-us but something happened to it..)
    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

  18. First 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 ?

    cmd.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

  19. I 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.

    Thank you!!


  20. 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.

  21. 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.

    any 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.

      If 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.

  22. Hi,

    We are trying to deploy “SERVERDATACENTER” instead of the “SERVERSTANDARD” you have selected in your “Select an image” step. But one issue we ran into is after we issued “setup /unattend:e:\autounattend.xml” command in WinPE command window, the first window the setup program pops up is another “Select an image” look-like but instead of 4 options, this time it asks you to select either “SERVERDATACENTER” or “SERVERDATACENTERCORE” which make this “unattend” installation not very “unattend”. Is there something I miss here to make this redundant selection appear on our installation process ? BTW, the unattend installation did go completely fine after I choose “SERVERDTACENTER”. One required end-user involvement is one too many for unattend install. Did you run into similar issue at all with your “SERVERSTANDARD” selection ? Thanks in advance for any reply on this issue.


  23. Great post! As for step 26 and using UltraISO to drop the autounattend.xml into the installation iso, ADK comes with oscdimg.exe that can do that. I used 7-zip (free) to unpack the Windows 2012 iso to C:\Win2012. I dropped the autounattend.xml into C:\Win2012, then change directory to where oscdimg.exe is (cd "C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg") and do: "oscdimg.exe -n -m -b"c:\Win2012\boot\" c:\Win2012\ c:\Win2012.iso". Boot a VM off of, or make a DVD to boot from, the C:\Win2012.iso just created.

    • I used the xml file with the encrypted password and forgot to change the password having updated the virtual machine. Unfortunately ended up locking myself out. I have tried all the obvious passwords but can't seem to log in. What is the password??

      • There are free crack disks that will let you reset the local admin password if you don't know it. You can also use the appropriate Microsoft software, like the ADK, to regenerate the unattended XML file with a new encrypted password.

  24. 1 of 3 Hi, I’m having an issue creating a fully unattended Win 8 Install. I have my wds request approval from all unknown computers, before beginning the windows install. I’ve tried both methods (simply approving, and “name and approve”.) Once I approve, it all goes well until I get the “personalize” and “PC Name” window of installation. I’d like to have that automated as well. Here are my “unattended.xml” and “answer.xml” one for WDS and one for the image, respectively. Please let me know what I need to add or change. Thank you in advance. I have to split up my comments.

  25. is there any change or update for R2? I followed this process for R2 and when it boots it gets stuck at the setup GUI screen asking the user to select the OS to install "Windows Server 2012 R2 Standard (Server core) or Windows Server 2012 R2 Standard (server with GUI). If I select server with GUI it then asks which disk to install it on. Then I get an error. This procedure in the blow worked fine for revision1 but is not working for R2.

      • I think I know the issue, I was using the Windows ADK for Windows 8 and loading the wrong install.wim file. When I selected the correct install.wim file from the R2 ISO the ADK Windows System Image Manager refuses to load the R2 image catalog or create a new one. I found out today that there is a Windows ADK for 8.1 (for R2) so I will try loading the correct install.wim into that to build the answer file and see if that works, I suspect it will. Will update here.

  26. Hi,
    I'm new on this topic.
    Do I have to create a *.wim-Image of my Server or can I mount an *.iso-Image in the Image Manager?
    How can I create a *.wim-Image?
    Currently I'm creating a Script to create and install a VM on my Hyper-V 2012 R2 Host and I need this unattend.xml for Installation.

      • Manual follow Derek's instruction in the blog, you must open the ISO file from Microsoft (I used Ultra ISO for this) and copy the install.wim file to your local drive. Then use the Windows System Image Manager to load the install.wim and build your answer file.

  27. I managed to get it working as expected with UltraISO. I'm frustrated with the MagicISO people – it's been two days and they have not responded to my requests for support.

  28. Two questions:
    step 5 – I am installing 2012 R2 Essentials and I get no selection box for different versions. Just select install.wim and bam, it's there. How do I get the proper name for step 16?
    Is that value really, specifically "/IMAGE/NAME" or should I fill in something like "/Sources/install.wim?"

    I am attempting a headless install onto an HP MediaSmart EX490, upgraded to an 8400 CPU and 2GB RAM onto a brand-new 4TB hard drive. I cannot tell where it is stuck, it never even looks like it starts. I am using a bootable USB stick and have verified that it does boot on another PC, launches the installer, and at least begins the autounattend.

  29. Hello,

    Thanks for posting this. It's very helpful information. I do have a problem that perhaps you or one of the readers could help with? I'm using Server 2012 R2. I created an autounattend.xml with my settings in it. I added some things that are not listed above. Specifically I added "Microsoft-Windows-ServerManager-SvrMgrNc", "DoNotOpenServerManagerAtLogon" set to "true" and I added "FirstLogonCommands", "SynchronousCommand" with a script to run. Everything I have configured in the autounattend.xml seem to work fine except for these two things. I've tried adding "Microsoft-Windows-OutOfBoxExperience", "DoNotOpenInitialConfigurationTasksAtLogon" as well and some other things, but still the Server Manager automatically launches during the autologon and none of the Synchronous Commands I add run. I've tried calling all sorts of scripts and batch files using different techniques and even calling executables directly. it just seems to ignore it. Do those only work if you are using a sysprepped image vs a original one?

    Thanks for any help,

  30. Hey!
    Works as aspected, just one question:
    I install Server 2012 R2 Datacenter on a Hyper-V VM.
    I mount the ISO and start the VM, but i have to "Press any key to continue".

    How can i skip this step for a "real" unattended installation?
    Thank for reply! KJV

    • Extract the Windows Server 2012 ISO image files or otherwise edit the ISO image and make the following changes:
      1. rename bootbootfix.bin to bootfix_yesprompt.bin
      2. rename efimicrosoftbootcdboot.efi to cdboot_yesprompt.efi
      3. rename efimicrosoftbootcdboot_noprompt.efi to cdboot.efi
      4. rename efimicrosoftbootefisys.bin to efisys_yesprompt.bin
      5. rename efimicrosoftbootefisys_noprompt.bin to efisys.bin
      This will remove the "Press any key" prompt when booting on BIOS or UEFI systems.