Inject Drivers into a Winclone Image

You are here:

If you are having issues with initial boot after restoring a Winclone image to new hardware, you can inject basic drivers into the Winclone image using the DISM command line tool in Windows 10. This only works if Windows has been sysprepped prior to imaging. Below are step-by-step instructions:

  • In macOS on the new hardware, download the current support software in Boot Camp Assistant. Select “Download Windows Support Software” in the Action menu. This will create a Windows Support folder on the desktop. Copy it to a FAT formatted USB drive.
  • Control-click on the Winclone image and select “Show Package Contents”. Copy the Windows.wim file to the FAT formatted USB drive as well. You may want to create a backup copy of the Windows.wim as well, since it will be related/modified.
  • On a Windows 10 PC or virtual machine, insert the FAT formatted USB drive.
  • Determine the index of the edition of Windows to inject the driver into.
dism /Get-Wiminfo /WimFile:D:\Windows.wim
  • Mount the WIM image from the USB drive by creating a folder at the root of the C drive, then mounting the WIM using dism. Note that in the following example, D: is the driver letter of the USB drive and the Windows.wim file is at the top of the D: drive. Make sure to change number in /index:1 to the correct index of the edition of Windows that you are injecting the driver.
<code>mkdir c:\wimmount</code>

If it does not return anything, then the directory was created successfully.

Next, mount the Windows.wim on the newly created directory. Run this command:

dism/Mount-Wim /WimFile:D:\Windows.wim <strong>/index:1</strong> /MountDir:C:\wimmount

If the command is successful, you will see a “The operation completed successfully” message.

  • Inject the drivers from the $WinPEDriver$ in the Windows Support software:
dism /Add-driver /Image:C:\wimmount /Driver:d:\WindowsSupport\$WinPEDriver$ /Recurse

If the command is successful, you will see multiple lines of drivers successfully installed. If most of the drivers are installed but there is a warning message (“The command completed with errors”), you can safely ignore the warning message.

  • Unmount the WIM file:
dism /unmount-image /mountdir:c:\wimmount /Commit

If the command completes successfully, you will see a “The operation completed successfully” message. Eject the USB drive and plug it into the Mac that contains the original Winclone image.

  • Copy the newly modified Windows.wim back to the original Windows.wim file in the Winclone image.
  • Restore the Winclone image.