Windows Unattend File

  1. Windows Unattended Answer File
  2. Windows Unattend File Storage
  3. Windows Unattend File Recovery

Unattended Windows installation is done via 'Answer Files', or 'Unattend files'.

These files are generally named 'autounattend.xml'. They are notPacker-specific tools, though we do make use of them.

Windows Unattended Answer File

You can use Unattend settings to prevent some or all of the user interface (UI) pages from appearing in Windows OOBE. To learn more about creating an answer file using Unattend, as well as a full list of Unattend settings available to you, see the Unattended Windows Setup Reference. Jul 03, 2020 Microsoft offers the Windows System Image Manager (SIM) console available through the Windows Assessment and Deployment Kit (ADK) to make it easier to create the file to install Windows 10. Aug 19, 2019 The unattend.xml file passes validation. I'm trying to do the minimum necessary things in unattend.xml at this point until I successfully get a Windows 10 Pro installation, so I'm no using any locale options or user account settings. I'm not using any partition information in the unattend.xml file since I am using the diskpart scripts specified.

If, after following this guide, you're still having issues getting an answerfile working, We recommend you read the official documentation onanswer files.

The guide here is hopefully enough to get you started, but isn't a replacementfor the official documentation.

»When To Use an Answer File

If you are installing the Windows Operating System from a mounted iso as part ofyour Packer build, you will need to use an Answer file. For example, you'rebuilding an image from scratch using the vmware-iso,virtualbox-iso, orhyperv-iso builders.

If you are not installing the operating system, you won't need to provide ananswer file. If you are using a pre-built imagein a cloud, you don't need to worry about Answer files.

»How to make an Answer File

You can either start from an example answer file from a known repo (take a lookat the examples links below), or you can generate one using an answer filewizard by selecting New File > New Answer file on a Windows machine.A comprehensive list of all the options you can set in an answer file can befound here

»Where to put the Answer File

Windows will automatically look for an autounattend.xml file on mounted drives.Many users use the floppy_files option or a secondary mounted iso forproviding the answer file to their iso builders.

You can also specify an unattend file to use by using the /unattend: option whenrunning Windows Setup (setup.exe) in your boot_command.

Windows unattend log file

»What does Packer need the Answer File to do?

Packer needs the Answer File to handle any questions that would normally beanswered interactively during a Windows installation.

Windows Unattend File Storage

If you want to be able to use provisioners, the Answer file must also containa script that sets up SSH or WinRM so that Packer can connect to the instance.

Windows

Finally, your Packer build will be much smoother if the Answer File handles ordisables windows updates rather than you tyring to run them using a Packerprovisioner. This is because the winrm communicator does not handle thedisconnects caused by automatic reboots in Windows updates well, and thedisconnections can fail a build.

»Examples

The chef-maintained bento boxes are a great example of a windows build thatsets up openssh as part of the unattended installation so that Packer canconnect using the SSH communicator. They functioning answer files for everymodern Windows version can be found here.

Windows Unattend File Recovery

Stefan Scherer's packer-windows repois a great example of windows builds that set up WinRM as part of the unattendedinstallation so that Packer can connect using the winrm communicator: