Updates

Create a Windows 10 Bootable USB Flash Drive on a Mac

To troubleshoot an issue with Windows 10 (especially boot-related issues), it can be handy to boot into Windows 10 not installed on a Boot Camp partition. It is relatively straightforward to create a bootable USB Flash drive to boot to the Windows 10 installer and open up a DOS prompt for troubleshooting.

What is needed

  1. USB Flash drive (8 GB or larger recommended)
  2. Windows 10 Installer ISO for Windows 10

Preparation

All the preparation is done in macOS on the Mac that is having an issue booting Windows. It is important to use this Mac since it will be used to identify the correct Windows drivers.

USB Flash Drive

The USB Flash drive must be formatted as exFAT.

  1. Insert an 8GB or larger flash drive into a USB port on the Mac
  2. In Disk Utility, format the Flash drive as exFAT. Quit Disk Utility after this operation completes.

Boot Camp Driver

Open Boot Camp Assistant in the Utilities folder and download the current Windows Support Software from the “Action” dropdown in the menu bar. Save the Windows Support Software to your desktop or other location. Do not save directly to the USB Flash Drive.

Windows Install Media

Download the current install media from the Microsoft website. Windows will not be installed, but the install media will give access to the command line tools in Windows. Select the version of Windows that is closest to the version of Windows installed on the Mac (Windows 8, Windows 10). It does not matter what edition of Windows is used, since Windows is not going to be installed.

Create Recovery USB Flash Drive

To create the USB Flash drive, follow these steps:

  1. Mount the Windows ISO downloaded from Microsoft. To mount the ISO, double-click on the ISO in Finder.
  2. Drag all the files and folders from the mounted ISO to the USB flash drive.
  3. Drag the contents of the Windows Support Software to the USB flash drive.
  4. If there is not an AutoUnattend.xml at the top level of the drive (as shown below), download AutoUnattend.xml, unzip it, and add it to the drive. AutoUnattend.xml provides the location of the $WinPEDriver$ folder to load the drivers during boot.
  5. The 2018 MacBook Air (and potentially Macs after that) cannot load the IntelMEI driver and give a “Windows Setup could not install one or more boot-critical drivers. To install Windows, make sure that the drivers are valid, and restart the installation” message. On the USB flash drive, open the $WinPEDriver$ and remove the IntelMEI folder.

Once the flash drive has been created, it should look like this:

The $WinPEDriver$ folder is important because it contains the drivers for Windows to boot successfully from the USB flash drive and the hardware on that Mac.

Boot from the USB Flash drive

To inject the drivers, the Mac must be booted from the USB flash drive.

  1. Insert the USB flash drive into an available USB port on the Mac
  2. Reboot while holding the Option key.
  3. Select EFI volume in the startup selector.

If Windows does not boot from the USB flash drive after showing the Windows logo, you may have to run the following command to tell the firmware to boot the Windows installer from the USB flash drive. This has been observed on the late-2014 Mac Mini but may affect other models as well. To set the variable:

  1. Disable SIP by booting to the recovery partition.
  2. Boot back to macOS and open Terminal. Run the following command and enter the admin password when prompted:

sudo nvram InstallWindowsUEFI=1

Insert the USB flash drive if it is not inserted, reboot, and select the EFI volume from the startup selector.

Note: the InstallWindowsUEFI variable is cleared at each reboot, so you will need to set it again if you do not select the USB Flash Drive.

Command Prompt and Mapped Drives

When Windows 10 starts up, it will prompt for installation of Windows 10. To open a DOS window, press fn-Shift-F10 (or just shift-F10) or click Repair Computer->Troubleshoot->Command Prompt (if available).

Once in the command prompt, there are usually 3 drive letters available: X, C, and D.

  • X: This is Windows that you are booted into in memory. The files from the boot.wim on the flash drive are copied to memory and then booted to
  • C: Boot Camp partition
  • D: The USB Flash drive

Running Utilities

Within the Windows command prompt, you can run utilities on the Boot Camp partition.

Run CHKDSK

Assign a Drive Letter

Mount EFI partition

Run Bootrec commands

Inject Drivers to WIM

Inject Drivers into Windows installed on Volume

Video

Buy me a coffeeBuy me a coffee