Skip to content

Script that creates a bootable Windows USB from a macOS machine

License

Notifications You must be signed in to change notification settings

sammyhori/win-from-mac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

win-from-mac.sh

This script can be used to create bootable Windows installation Media from a macOS system.

Creating bootable Windows installation media on a macOS system is not straightforward. Microsoft does not provide a dedicated tool for this purpose, and many of the most popular tools available are proprietary, paid, and may not always work reliably, according to user reviews.

This script aims to provide a relatively simple, open-source solution to this issue.

This script mostly follows the pattern set out by Alvaro Carril in their GitHub Gist.

This has been tested with Windows 10 and 11 on a USB drive. I do not know if it will work with earlier versions of Windows.

If you would like a more complete solution it may be worth looking at WinDiskWriter which appear to have TPM and Secure Boot requirements removal, along with a simple graphical user interface. I have not used it myself, so I cannot vouch for its usefulness.

Prerequisites

  • A sufficent USB drive (at least 8GB) - this will be erased, so backup any wanted data on it first.

Software

This script requires either wimlib or brew to be installed. If wimlib is not installed, it will be automatically installed using brew.

Also required are:

  • awk
  • diskutil
  • hdiutil
  • rsync
  • stat

But these are generally installed by default on macOS.

Usage

  1. Download the Windows ISO file from the Microsoft website,
  2. Insert a USB drive (at least 8GB) into your Mac, finding the disk identifier (e.g. disk4) using diskutil list before and after insertion,
  3. Run the script with the ISO file and the disk identifier as arguments:
win-from-mac.sh /path/to/iso diskX
  1. The script should run, erasing the USB drive and copying the contents of the ISO file to it, including the Windows installation files.
  2. Once the script has completed successfully, you should have a bootable Windows installation USB drive, which you can safely remove as the script will unmount it for you.

This document contains links to other works that are not maintained by, provided by or affiliated with me. I cannot guarantee the relevance, completeness or security of these works. Use them at your own risk.

About

Script that creates a bootable Windows USB from a macOS machine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages