Chris Hall bio photo

Chris Hall

Principal Technical Consultant

    Bluesky     LinkedIn   Github     YouTube Join Nutanix Multicloud Experts Chris Hall Nutanix Certified Master - Multicloud Infrastructure 6 Chris Hall VMware vExpert 2024 Nutanix Certified Professional - Cloud Integration Chris Hall Nutanix Certified Professional - Multicloud Infrastructure 6 Chris Hall Nutanix Certified Professional - Unified Storage 6 Chris Hall VMware vExpert 2023 Chris Hall VMware vExpert 2022

Tools Out! Following on from my Injecting Drivers into Windows Server 2025 Installer post where we injected Nutanix drivers into the Windows Server 2025 installation media, what else can be done to simplify the creation of a Windows Server 2025 virtual machine?

Sure we can create a Windows Server VM template (the documentation for which is here: VM Template Management), however we will still need to create a VM from which we can create our template.

So why not simplify the creation of the template and subsequent VM creations from the template with a Windows installation unattended file?

Overview

The Problem: Windows Unattended Files are Painful

The Windows unattended installation answer file takes the format of an .xml file. For those unfamiliar with .xml files, they look like this:

For Example

Yep, not the easiest file format to create and modify by hand. Whats more, troubleshooting is a severe pain in the rear.

There must be a better way?!?

The Solution: Windows Answer File Generator

Introducing Windows Answer File Generator from Sven Groot on GitHub.

To quote Sven’s GitHub page:

The Answer File Generator is a command line application and library for generating answer files for unattended Windows installations. These files are commonly called unattend.xml or autounattend.xml (depending on the installation method used).

This tool can be used to generate answer files as part of an automated workflow for installing Windows, or just as a convenient way to generate answer files for personal use, without the need to install the Windows System Image Manager, or manually edit XML files.

Answer files can customize many aspects of the Windows installation, only some of which are available through this tool. Customizations supported by the Answer File Generator include:

  • The installation method, partition layout, and target disk and partition.
  • Enabling optional features during installation.
  • Creation of local user accounts.
  • Joining a domain, and adding domain accounts to a local security group.
  • Configuring automatic log-on.
  • The product key, computer name, language/culture, and time zone.
  • Display resolution.
  • Disabling Windows Defender.
  • Enabling remote desktop access.
  • Running PowerShell scripts and other commands on first log-on.
  • Answer files generated by this application will always skip the entire OOBE experience, unless no local account was created and no domain was joined.

For me, it’s the pure simplicity in running Sven’s Answer File Generator application that has me hooked. The fact that options are supplied in the form of commandline switches is what makes this a killer application for creating Windows unattended files.

Grab your copy now from the releases page and don’t forget to star Sven’s repository whilst you are there! :star:

Examples

For example, lets create a Windows Server 2025 autounattend.xml file that includes the following options:

  1. Install a 64 bit version of Windows on the first disk of a UEFI system, using the Windows default UEFI partition layout
  2. Use UK GMT TimeZone
  3. Stop Windows Server Manager from popping up at logon
  4. Enable Remote Desktop server for remote admin access
  5. Set Computer Name to SERVER-2025

Simple:

.\GenerateAnswerFile-2.0.0-x64.exe `
-Install CleanEfi `
-TimeZone "GMT Standard Time" `
-DisableServerManager `
-EnableRemoteDesktop `
-ComputerName "SERVER-2025" `
-OutputFile autounattend.xml

I’ve used backticks (`) in the above to line wrap the command options making them easier to read. The above (including backticks) can be run as is from the PowerShell command line.

When run and the autounattend.xml opened in notepad (I won’t include the whole autounattend.xml, but you get the idea):

For Example

Some other options that jump immediately to mind:

-ProductKey   = Product key used to select what edition to install, and to activate Windows
-ImageIndex   = The index of the image in the WIM file to install. Used editions not installed using a product key (eg evaluation)
-JoinDomain   = Name of a domain to join. Used with appropriate username + password
-LocalAccount = Local account to create, using the format group:name,password or name,password

Many other options are available, see Sven’s documentation: Windows Answer File Generator Command line arguments.

Testing

As usual, I’m going to use the Windows Server 2025 evaluation version available from:

I’ll be installing into a Nutanix VM, so I’ll follow my own post:

because I want this to be a “hands off installation”.

I’ll create my autounattend.xml to install Server 2025 standard with desktop evaluation using the following:

.\GenerateAnswerFile-2.0.0-x64.exe `
-Install CleanEfi `
-ImageIndex 2 `
-TimeZone "GMT Standard Time" `
-DisableServerManager `
-EnableRemoteDesktop `
-ComputerName "SERVER-2025" `
-LocalAccount "Administrator,Password123!" `
-OutputFile autounattend.xml

I have uploaded a copy of the generated autounattend.xml HERE for your perusal.

Lets test. In Nutanix Prism Element (the same functionality is present in Prism Central), I’ll create a VM as normal and I’ll supply my generated autounattend.xml file:

Add Unattended

Save and lets go:

Let my sensual voice sooth your ears!

-Chris