Creating custom ISO from Windows 10

iso-image

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.

Best Answer

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!

Related Question