Create a Custom ISO for Windows 10 — Part 5 of 6

Tags:
By Kari the Finn, guest blogger for Ed Tittel, courtesy of TenForums.com
Note: this blog is Part 5 in a series of 6 parts on the topic of using Sysprep to craft a custom ISO for use in installing Windows 10, aimed at the upcoming Creator’s Update scheduled for public release in mid to late April. Your guest blogger for this series is Kari the Finn, well-known Windows Install expert at TenForums.com. He’s the person who put tools together (ESD2ISO and UUP2ISO) that let savvy installers convert Windows OS download files into ISO images that may be used to create bootable installation optical media or USB Flash Drives. Part 1 of this series covered the intro, and Part 2 started users with installation prep; Part 3 explains how to update and customize Windows; Part 4 digs into generalizing a Windows image using the Sysprep utility. Here in Part 5, Kari explains how to capture a generalized Windows image and use it to create an ISO for installation. Don’t let the numbering bother you (Part 1 was an introduction, so step 1 appears in Part 2, step 2 in Part 3, and so on…)
4. Capture Windows image, create ISO
Once Sysprep finishes working its magic, the Windows 10 installer shuts down. Boot the technician machine using the Windows 10 install media, the same you used in the beginning to install Windows. Do not let it boot from hard disk, an HDD or SSD if using a physical machine or VHD) if using Hyper-V!
At the first prompt when Windows setup asks for region and language settings, instead of selecting anything and starting installation, press SHIFT + F10 to open the Recovery Console Command Prompt. Type diskpart and press Enter to start the Disk Partitioning Utility, then type list vol to list all available volumes (partitions). For example, on my Hyper-V VM list vol shows this information:
This is why we named our disk partitions in Part 4, so we can identify them here. Note: the Recovery Console does not use the same drive ID policy as Windows 10. Thus, we need to be sure which drive has Windows installed (as shown above, it appears as drive D:) and which drive will store the captured image for customization and re-use (as shown above, it’s drive E:).
Type exit and press Enter to exit Diskpart.
DISM Does All the Hard Work!
Type (or Copy & Paste) the following command:
dism /capture-image /imagefile:E:\install.wim
/capturedir:D:\ /ScratchDir:E:\Scratch
/name:"W10PROx64" /compress:maximum
/checkintegrity /verify /bootable
If you do copy and paste, remove the spurious line feeds used to make the text visible and readable inside WordPress.
Please check and note the following important details:
- /imagefile:E:\ = drive where install.wim will be saved
- /capturedir:D:\ = drive where Windows is installed
- /ScratchDir:E:\ = drive where temporary working folder Scratch is located
- /name: = any name you like in quotes, not important but obligatory, here I identify the version as 64-bit Win10 Pro
Press Enter to start. Note: this will take some time to complete. On slow physical machines it can take up to 20 – 25 minutes. During the first half of that period you’ll get no progress indicator, either. Just be patient: it will work!
When this command has finished, eject the install media (in Hyper-V select Media menu > DVD Drive > Eject). Next, close Command Prompt and restart the technician machine. This time boot normally from HDD / VHD and let it work through normal OOBE setup.
While the Windows Installer Does Its Thing…
While the technician machine is preparing and setting up Windows, double click the original Windows 10 ISO image you used to mount it on the host computer as a virtual DVD. Then, open it in File Explorer, copy its entire contents (all files and folders) to a new folder on the host HDD. I named this new folder ISO_Files, creating it on drive D: on my host.
When the technician machine is ready and your initial user is logged into the desktop, copy your newly created install.wim file from the image drive (E:) to the Sources subfolder in the folder where you copied the original Windows installation files. In this example, that’s D:\ISO_Files\Sources folder. It will replace (over-write) the original Windows 10 install.wim file.
Hyper-V users should also create a checkpoint now on their technician VM to capture a pristine system image.
Bring on the (Windows Imaging) Tools!
Run Deployment and Imaging Tools Environment elevated, as an admin. It is installed as part of the Windows ADK and can be found in Start > W > Windows Kits. Type CD\ and press Enter to set the working folder to the root of the C: drive. Enter this command:
oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,
bd:\iso_files\boot\etfsboot.com#pEF,e,
bd:\iso_files\efi\microsoft\boot\efisys.bin
d:\iso_files d:\Win10PROx64.iso
Please notice: the preceding command is one long continuous command line though it breaks across multiple lines in this blog post. If you cut’n’paste this text remove the spurious linefeeds that WordPress required to make the entire text readable.
Check and the note following details, please:
- d:\iso_files = path to folder where you copied original install files
- d:\Win10PROx64.iso = path and your preferred name for new ISO
With all this work completed, making the ISO takes just a minute or two. When that’s done you can burn the ISO to a DVD or Flash drive, it will work on both BIOS / MBR and UEFI / GPT systems to install your customized Windows with its pre-installed software.
Moving On…
This concludes Part 5 of this 6-part series. Part 1 covered the intro, and Part 2 started users with installation prep; Part 3 explains how to update and customize Windows; Part 4 digs into generalizing a Windows image using the Sysprep utility. Here in Part 5, Kari showed how to capture a generalized Windows image and use it to create an ISO for installation. The sixth and final part explains how to update and maintain this ISO as changes and updates come along. It should post shortly to conclude the whole shebang!
Links to All Series Parts (1-6)
Part 1: Introduction & Overview
Part 2: Install Windows and Prepare Assets
Part 3: Update and Customize Windows, Install Software
Part 4: Generalize Custom Windows Image with Sysprep
Part 5: Capture Custom Windows Image, Create ISO
Part 6: Update/Change Custom Windows ISO
24  Comments on this Post
I followed this guide using a W10_pro_1709 installer. I got through the end of this section and when I try to install this newly created ISO and click on, "I don't have a product key", I get an error that says: "Windows could not display the image available for installation".
Any thoughts on this?
[PID]
value=VK7JG-NPHTM-C97JM-9MPGT-3V66T
That will cause Windows 10 PRO to install without asking you for a product key or which version you want to install. If you have a digital entitlement for Windows 10 Pro saved on Microsoft activation servers, it will activate automatically. If you don't, then you will have to go to the activation screen, change product key, and enter your Windows 10 Pro product key to activate it.
[PID]
value=your-KEY-HERE-XXXX-XXXX
That will cause Windows 10 PRO to install without asking you for a product key or which version you want to install.
Edje88 is absolutely correct. The generic key shown in one of the preceding posts will work for installation, but you'll still need a valid retail, OEM, or volume license key for activation. Thanks!
--Ed--
Edje88 is absolutely correct. With a PID file you can even use the generic key provided in an earlier post for installation. You'll still need a valid key for activation later on, but that will get you through the install process.
Thanks!
--Ed--
Other than that, I have only seen this happen when for some reason the bootloader is wrong. If for any reason your machine boots with 32 bit boot image, then runs 64 bit Windows installer, there are no valid images available thus the "No valid images available" will be shown.
So far I got stuck at the last step. The DISM commando executed successfully. When I restart the technician machine from the HDD, I get the error
"Windows Couldn't not finish configuring the system. To attempt to resume configuration, restart the computer."
See screenshot https://imgur.com/a/UXLt4fT . What does that error mean and how can we fix it?