Winclone Restore of WIM from ISO

I have been investigating using the WIM file from inside an Windows 10 installer as the basis for a Winclone restore, and I have some results to share. Here is what I did:

  1. Extracted WIM from ISO.
    I downloaded en_windows_10_enterprise_n_version_1703_updated_march_2017_x64_dvd_10189280.iso from Microsoft and found the install.wim in sources.
  2. I copied that file to my desktop, renamed the install.wim file to Windows.wim, and replaced the existing Windows.wim in a file-based Winclone image. I first right clicked on the image, selected “Show Package Contents”, then replaced the current Windows.wim file:

  1. I then restored that image to a boot camp partition using the current Winclone 6.1 beta (earlier versions had some file permission issues with some ISOs.

  2. I then booted into Windows and there was a generic Windows 10. However, on my MacBook Pro (touchbar) the keyboard and mouse didn’t work (as well as a lot of other stuff that required drives, I’m sure).

  3. I then restored the same Winclone image again, but before booting into it, I mounted the Boot Camp R/W using the “Mount Read/Write” feature in Windows 6.

  4. I then downloaded the current Boot Camp drives from inside Boot Camp assistant:

  1. I put the BootCamp folder and WinPE into a folder called Winclone and copied that to the root of the Boot Camp volume. I don’t believe the WinPE folder was used, but it was nice to have it there in case it was needed by the MSI.

  2. Now I needed something to actually install the drivers on first boot. I created an unattend.xml and put it in Windows/Panther/Unattend folder (I had to create the folder structure as well). The unattend.xml looks like this:

The unattend did 3 important things:

  • Creates a user
  • Allows autologin of that user on first boot
  • Runs a script C:\Winclone\logon.bat when that user first logs in.

The script is very simple. It just installs the boot camp drivers. Here is the entire script:

msiexec /i C:\Winclone\BootCamp\Drivers\Apple\BootCamp.msi /qb- /norestart


  1. I then copied the script to the boot camp partition in the Winclone folder at the root. The final result is this:

I then booted into Windows and after a few minutes of it configuring itself, the user was logged in and all the drivers were installed.

The really interesting pieces of this are:

  1. Windows was never booted into until that first boot. This makes for a very clean image.
  2. The drivers are installed separately so that they can be updated separately from the image.
  3. You can add in all sort of additional hooks. Specifically, you can add in a script to bind to AD and install SCCM. After that, the MS tools can install and configure the box.

Let me know what you think. My current thought is to add this to WInclone Pro as a feature to “import WIM”, and when you do, a sheet similar to the package tool appears. You will then be able to specify options such as scripts to run and resources to include.


1 Like

As someone who appreciates having multiple options regarding recovery/reinstallation of my various computers I truly applaud your efforts.

I use the Bootcamp Windows 10 on my MacBook Air to test the Windows 10 Preview releases. As this process itself is sometimes a bit taxing on the stability of the Windows 10 installation, having multiple ways to get back to a working system is always welcome! :slight_smile:

Great! We are going to be adding in additional WIM / ISO support.

read restore_device // example /dev/disk3s3
read index // it is related with Windows Edition, Home or Pro etc

diskutil umount ${restore_device}

// create NTFS

sudo ./tools/bin/mkntfs -Q -L BOOTCAMP ${restore_device}

// apply Windows image

sudo ./tools/bin/wimapply /Volumes/*/sources/install.wim index {restore_device}

diskutil mount ${restore_device}

// create EFI-boot (maybe MBR works too? I don’t need it)

sudo ./tools/bin/winclone -p ${restore_device} -e

this simple script works for me :slight_smile:

another option is
winclone --self-extract -p ${restore_device}
but it cannot work with multiple indexes in one WIM

Will this work with Windows 10 Education? Also where am I running this script to allow my .WIM to be identified by boot camp for dual boot?

it works with any edition windows “install.wim” file
default paths to all binaries are

you can modify the script for your needs easily , if you know what are you doing
dont do it if you don’t ))

1 Like

there is ONE tool for
wimlib-imagex info
wimlib-imagex apply
and many others

and a question…
WinClone uses
mkntfs -S 63 -H 255 -p 411648 -Q -L BOOTCAMP
to format a partition
Are 63 255
any constants, or they need to match the real HDD?
mkntfs -Q -L BOOTCAMP
works too with default settings (?) , what is the difference?

disk geometry can be obtained from
fdisk: 1> p
Disk: /dev/disk1 geometry: 97451/255/63 [1565565872 sectors]
but I have no idea what is 411648

WinClone 7* can select index from image!

1 Like

WinClone 8
mount Windows install ISO
cd /Applications/
sudo ln -s /Volumes/*/sources/install.wim ./Windows.wim
sudo ./winclone --y -e -p /dev/disk9s9 -i 4
and wait :slight_smile:
disk9s9 must be FAT32 formatted

1 Like