Skip to content
Advanced

Building a custom Windows ISO with WIMUtil and autounattend.xml

A zero-touch installer that boots, installs, skips the account nag, injects drivers and lands on a desktop I recognise. It took three failed attempts to get right.

What I was trying to build

A USB stick that I can put into any of my machines, boot, walk away, and come back to a signed-in desktop with my settings applied, my drivers present, and none of the setup interrogation in between. That is the whole ambition. It is achievable, and it took me three attempts.

The pieces involved

  • An answer fileautounattend.xml — which Windows Setup reads automatically from the root of the installation media and uses to answer its own questions.
  • A tool to generate that file from the settings you have already chosen, so you are not hand-editing XML schemas at midnight.
  • WIMUtil, for the media side: taking a Windows ISO apart, injecting drivers, converting image formats and building a bootable ISO back out.
  • A stock Windows ISO from Microsoft. Always start from Microsoft's own media, which this site neither supplies nor links to. An image from anywhere else is an unknown binary with administrator rights over your life.

Only use official media

Pre-modified "lite" or "ghost" Windows images circulate widely and are the single worst idea in this hobby. You have no way to audit what was changed. Get your image from Microsoft, modify it yourself, and you know exactly what is in your image because you put it there.

Generating the answer file

The generator produces an autounattend.xml reflecting the choices you have already made in the interface — which apps to skip, which optimizations to apply, region and keyboard, account behaviour. It writes a file; it does not write your ISO. Keep the two steps separate in your head and the process gets much clearer.

Open the file afterwards. It is XML, it is readable, and skimming it is the fastest way to understand what setup is actually going to do. I found one region setting I had left wrong this way, before it cost me a reinstall.

Building the ISO

  1. Point the tool at your stock ISO

    It mounts the image and shows you what is inside, including the editions available in the install image.

  2. Add the answer file

    It goes at the root of the media. Setup looks for it there by name, with no further prompting.

  3. Inject drivers if you need them

    Storage and network drivers are the two that genuinely matter. A machine whose NVMe controller setup cannot see is a machine that stops at the disk selection screen.

  4. Build and write to USB

    Then test in a virtual machine before you test on hardware you care about. A VM run costs you ten minutes; a bad install on your main machine costs an evening.

Three failed attempts

Attempt one hung at the disk selection screen. Missing storage driver for a newer chipset. Injecting the vendor's driver package fixed it.

Attempt two installed perfectly and then sat on the region screen, ignoring my answer file entirely. The file was in the wrong place — inside a subfolder, not at the root of the media. Setup does not go looking.

Attempt three worked, but created an account I had not intended because I had left an account section half-configured. Re-read the generated XML, fixed one block, rebuilt.

Test in a virtual machine every single time

Every one of those failures cost me ten minutes in a VM instead of an hour on hardware. Build, boot it in a VM, watch the whole install, then commit it to a USB stick.

Is it worth it

If you install Windows twice a year, no. Use the normal installer and import a config afterwards — you will get most of the benefit for a fraction of the effort.

If you install Windows monthly, look after machines for other people, or rebuild test systems regularly, it is transformative. My current stick takes a machine from bare metal to a desktop I recognise in about twenty minutes of unattended time, and the only thing I do is choose the disk.


Written on my own hardware, with my own money, on my own time. Nobody paid for a mention here. If a page ever does contain a paid placement or an affiliate link, it will say so at the top — see the disclaimer.