6

I have been tasked to create some images for Windows 10 pro, for virtual machines and also native installs. The VM image is simple, but I am having trouble on how to extract an iso image from the Windows 10 configuration I have created. Moreover, this needs to be an image that we can use for a bare-metal install, so the default Windows system image tools won't cut it(it creates a .vdhx file, we need it to be able to boot straight from BIOS).

I know there are some programs out there that will create an iso based on some of the program's configurations, but this is a fairly in depth image my superior is wanting(He is wanting a bare bones minimal image, with specific user accounts already set up, ect). I haven't seen any program that will customize the image the way I need it(we want everything gone, even calculator and other stock programs which are difficult to remove). To add to this, my superior is against anything third party, so that need to be a last resort option.

The only option that I have thought of is use a program to create an image close to what I want, which the computer name/users/ect. already set up, then I may be able to create a script that will do most of the rest, but this needs to be as automated as possible.

So, has anyone seen any way to create an bootable iso from a custom Windows 10 setup? I've been searching for two days, and have not found anything that fits all the criteria I need.

8

3 Answers 3

7

Instead of focusing on creating a custom ISO, you should read about WIM image that are meant for deploying in a more efficient way. You will probably need some patients, effort and additional research. It took me like 5 tries to get one working when I first tried to do this.

The steps are a bit complex, but not impossible. I will try to do the best to explain how you can achieve this. If someone has any other ideas/experiences, please leave a comment, and I will include it in my answer.

So lets start with the tools you will need:

  • Windows (10 PRO) installation image/disk/USB
  • A workplace where you can install your Windows 10 Pro and customize it as you like. This can be a Notebook, a PC or a Virtual machine
  • A network share where you will store the WIM image
  • A Bootable Windows live CD/DVD/USB/ISO (BartPE)
    I will not go into details of creating a BartPE live CD, but this should be simple and there are tons of guides that will show you how. Check this for example.
  • A tool to capture Windows and create the WIM image
  • Some basic knowledge of using the command line

  1. Installing and customizing Windows on your PC/Notebook/VM.

  2. Backup.
    After you are done with the customization, you should create backup/snapshot of the current state since step 3 is where I also failed most of the times. And it takes lots of time to do the first step again from the beginning.

  3. Running sysprep.
    Start -> Run -> sysprep

    • On the first dropdown menu, select OOBE - this means that next time when you start Windows it will act like it is the first time running it, asking for new username, language, etc.
    • Check generalize - this is needed if the image will be deployed on multiple PCs, meaning that the driver ID tags and other hardware specific options will be deleted and updated the next time when Windows is started.
    • For shutdown options, you want to select Shutdown since we want to capture the image right after the changes are done.
  4. Capturing the custom Windows.
    You can use multiple tools to capture the current state as a WIM image. You can use imagex, DISM, etc. When I did it, I used gimagex so for now I will use it as an example.

    • You need to download gimagex and save it to your network share.
    • Without starting Windows, boot with your BartPE.
    • type: net use * <path to your network share>
    • type Z: than navigate to your gimagex folder and run the one found in x64.
    • in the capture tab, select the source (your Windows install partition) and select destination (a folder you'd like in your network share)
      you can give a name and description. Leave the rest on default unless you know what you are doing.
    • after the capture was done, you can start your original Windows and check if it starts. If not, something went wrong, do some research, restore your backup and start over from step 3.
  5. Applying the WIM image.

    • You should prepare a script on your network share to make your life easier. I provide you the script you will need:

[image.bat]

@echo off
diskpart /s z:\diskpartrans.txt

[diskpartrans.txt]

select disk 0
clean
create partition primary size=100
select partition 1
format fs=ntfs quick label=system
active
create partition primary
select partition 2
format fs=ntfs quick label=windows
assign letter=g

This will format the drive and create the necessary partitions for your image. You can also manually do it, but it is easier this way.

  • So just as before, you boot with BartPE
  • net use z: <your share>
  • navigate to image.bat and run it
  • once it finishes, navigate to your gimagex and run it.
  • this time use the Apply tab, source is your WIM image on the network share and Destination is G: because this is the letter we assigned in the script.

And that is all. Good luck!

6
  • 1
    "Instead of a custom ISO, you can create a custom WIM image " - But that is exactly what creating .WIM does, could "update" the Windows media to apply your .wim file if you want ( just replace it ), Good answer, but the fact you don't know what creating a .wim allows you to do, is disturbing.
    – Ramhound
    Commented May 21, 2016 at 2:29
  • @Ramhound - if I did not use the right words, feel confident to edit my answer.
    – Divin3
    Commented May 21, 2016 at 2:33
  • I stick to edits that don't change an answer or question in any significant way. You should improve your own answer.
    – Ramhound
    Commented May 21, 2016 at 2:37
  • @Ramhound - updated my answer. This is what I originally meant. Any other observations I should edit?
    – Divin3
    Commented May 21, 2016 at 2:48
  • @Divin3 really in depth. That should get me close, and I'm sure I can research anything problems I may come across. Thanks!
    – fishyflop
    Commented May 22, 2016 at 2:06
3

You will need 2 PCs for this -- a test PC and a tech PC (the tech PC will be your PC). You are also going to need 3 USB drives for this:

  • 1 64 GB USB drive to capture the image with.
  • 1 32 GB USB drive for your Windows 10 ISO to be mounted on. (More on this later).
  • 1 32 GB USB drive for Windows PE.

NOTE: You will also need the Windows 10 v1803 ADK -- install everything, it takes just under 9 GBs for the total install.

  1. Download the ISO image of Windows 10 Pro from the Official Microsoft site.

  2. Download Rufus and familiarize yourself with the program.

  3. Open the Windows 10 ISO file using Windows Explorer.

  4. Go to the \Sources directory, and copy out the "install.wim" or "install.esd" file to the C:\mount directory. If you do not have this directory, create it. Rename the .wim or .esd to .wim.bak or .esd.bak.

  5. Mount the Win 10 ISO to a USB stick using Rufus, making sure you use the GPT schema for UEFI.

  6. Install Win 10 from USB to a test PC (not a VM). When you come to the first user-configuration screen (normally Cortana), hit CTRL + SHIFT + F3 to enter Windows 10 Audit Mode. The PC will reboot a time or two, but then it will log you into the Windows hidden Administrator account.

  7. Install all the apps you want / need, including MS Office, Adobe Acrobat / Reader, Chrome, FireFox, etc., but do not activate any of them, and do not activate Windows. Sysprep kills activations (it also kills drivers, so make sure you include all the drivers you need in a C:#Installs folder. Example: We have Dell OptiPlex 5260 AIO's, so I downloaded all the drivers to my C:#Installs\OptiPlex 5260\ directory.).

  8. Run all your Windows Updates. Once they are done, configure all your privacy settings, turn off the gaming, Cortana, consumer experience, etc.

  9. Run your Windows cleanup scripts / uninstall all the garbage that M$ is jamming up the Start Menu with (Candy Crush, etc). Run Disk Cleanup on the C:\ drive, run CCleaner, etc. This will ensure the smallest footprint for the WIM file you will be creating shotly.

  10. Copy your prepared Unattend.xml file to the C:\Windows\Panther directory.

  11. Open an elevated Command Prompt from C:\Windows\System32\cmd.exe and type the following: Sysprep.exe /generalize /oobe /shutdown /unattend:C:\Windows\Panther\UNATTEND.xml

  12. The PC will shutdown; remove your Windows 10 ISO USB stick you booted off of and replace it with your Windows PE USB. Also plug in your 64 GB USB drive, so you can capture a WIM image of Windows 10.

  13. Start the test PC and boot to the WinPE USB. You will be at the X:\ terminal (a basic command prompt-type program), where you will type DISK PART and hit Enter.

  14. Once you are in Disk Part, perform the following commands: list disk and list vol. Make note of the info in there. SDA0 will be your HDD, SDA1 will be your USB, SDA2 will be your other USB drive. Make note of which SDA is which, and which volumes have which letters. If the volumes do not have letters, assign them accordingly.

  15. Exit Disk Part by typing EXIT and you will be back to the X:\ terminal. Once back there, type the following: dism /capture-image /imagefile:D:\install.wim /capturedir:C:\ /Name:"Win10v1803" /Description:"Win10v1803" /bootable

  16. Replace C:\ and D:\ with your own drive letters, where D:\ is your 64 GB USB stick and C:\ is the Windows C:\ drive. Sometimes my USBs will be marked as F:\ and W:\, etc., so make sure you are pointing DISK to the correct volumes / partitions / disks.

  17. The WIM file capture and recreation process is now underway, and it will take about 45 minutes to an hour (on average) to capture the image.

  18. Once the WIM image is done being captured, it will say something like this:

Deployment Image Servicing and Management tool Version: 10.0.17134.1

Saving image [==========================100.0%==========================] The operation completed successfully.

X:\windows\system32>

  1. At the X:\ terminal after the image is captured, type WPEUTIL SHUTDOWN and the PC will shutdown. Remove the two USB drives, putting the WinPE one to the side and taking the 64 GB over to your tech PC, along with your Windows 10 Install USB -- Plug them both in, and take a look at how big the newly captured WIM file is (mine are normally between 10 and 15 GBs, depending on how many programs and updates I have installed, as well as how many drivers I have set aside for later).

  2. Move the newly created WIM file to your C:\mount directory, you may need it later. Once the WIM file is in the C:\mount, copy the file once more to the Windows 10 Install USB drive's \sources directory, over writing the original file in there.

  3. Once the new WIM file is copied to the Win 10 Install USB, you can use that USB to install a custom Windows image to any PC you want.

    • If you have a program like UltraISO, you can resave the original ISO with the new WIM file in there, which will allow you to mount the custom image to multiple USB drives, and which will allow you to install the custom image to many different form factors and models of PCs.

    • If you will be using ImageX, GImageX, WImageX, etc., then do not worry about recompiling an ISO for later use. I prefer recompiling the ISO, however. It allows me to have multiple ISOs for multiple ORGs within our company.

Hope this helps, it took me months to get to be able to explain this so simply and to perform these actions myself. Anything I can do to help people is exactly what I wanted for myself months ago -- an easy walk through...too bad I didn't find one...lol

2
  • 1
    Did you copy that from somewhere? If yes, please list your source. If not: Wow, that's one hell of an answer. Votes up!
    – confetti
    Commented Aug 27, 2018 at 5:39
  • 1
    No, that was me typing it all out...lol I had to be able to create an SOP for the company I work for on how to do this also...it took me over a year to get to that point...lol
    – Vincint
    Commented Apr 25, 2019 at 21:10
0

Having just finished a project writing a Windows customization tool stack for the enterprise, I would like to contribute some points:

The basic steps are

  • get the ISO from MSDN
  • mount and copy out sources/install.wim
  • mount the wim image using dism (preferably using powershell)
  • edit the files in the mounted directory
  • dismount and save changes
  • boot your target PC using Windows PE
  • apply the wim image to the PC's hard disk
  • reboot and done!

It can get kind of complicated, especially when it comes to editing the files in the mounted directory. When in doubt, Microsoft docs on hardware OEM is your best friend.

In my experience, going to audit mode and sysprep again from a live system doesn't work exactly as it should, so I tend to avoid it altogether. This is significant in Windows 10 (1709), where unattend.xml stops honoring flag.

Anyhow, be careful of some tools that offers easy one-click customization or use loads of crazy batch files. I guess that is why I built my own tool. It leans towards more advanced IT professionals, but it might be useful for your situation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .