In the following procedure we will create a Microsoft Windows bootable USB flash drive in macOS, from scratch with command line. Root privileges are required.
Note: This works only with BIOS or UEFI CSM (supports old BIOS style booting). Not compatible with native UEFI.
Note: This works only with BIOS or UEFI CSM (supports old BIOS style booting). Not compatible with native UEFI.
Dec 2, 2018 - These instructions will guide you to quickly make a bootable USB installation media for Mac OS X on Windows, this works with Yosemite. How To Create macOS Sierra Bootable USB Drive On Windows February 23, 2017 silicon Apple recently renamed its Macbook operating system OS X to macOS, and in addition introduced the upcoming macOS Sierra operating system, the macOS Sierra is the most recent version of macOS.
Test environment: macOS 10.13.1
Requirements:syslinux 4.03 and port of syslinux 4.03 to macOS
Requirements:syslinux 4.03 and port of syslinux 4.03 to macOS
Warning: All the data on the USB flash drive will be destroyed without warning! Make sure you selected the correct drive or you will destroy a wrong disk!
1. Identify the USB flash drive, in my example the device is /dev/disk2.
2. Erase the /dev/disk2, create one big partition /dev/disk2s1 and format as FAT32 with the label “WINDOWS”. All data on /dev/disk2 will be destroyed!
diskutil partitionDisk /dev/disk2 1 MBR FAT32 WINDOWS R
3.Set bootable flag on, start fdisk and enter the commands with red text.
Enter ‘help’ for information
fdisk: 1>flag 1
Partition 1 marked active.
fdisk:*1>write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
fdisk: 1>exit
fdisk: 1>flag 1
Partition 1 marked active.
fdisk:*1>write
Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] y
Writing MBR at offset 0.
fdisk: 1>exit
4.Download and unpack syslinux 4.03 source code.
curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-4.03.tar.gz -o syslinux-4.03.tar.gz
tar -zxvf syslinux-4.03.tar.gz
5. Download syslinux macOS port and make it executable.
curl https://www.oueta.com/wp-content/uploads/2018/10/syslinux-mac.tar.gz -o syslinux-mac.tar.gz
tar -zxvf syslinux-mac.tar.gz
chmod +x syslinux
6. Unmount and write the bootstrap code (mbr.bin) to the MBR of /dev/disk2.
dd if=syslinux-4.03/mbr/mbr.bin of=/dev/disk2 bs=440 count=1
7. Install syslinux, this will alter the boot sector and copy ldlinux.sys into the root directory.
8. Copy syslinux BIOS modules and create syslinux.cfg.
mkdir /Volumes/WINDOWS/syslinux
cp syslinux-4.03/com32/modules/*.c32 /Volumes/WINDOWS/syslinux
9. Create with a text editor /Volumes/WINDOWS/syslinux/syslinux.cfg and add the following:
10. Mount the Microsoft Windows ISO image, please replace /example/windows.iso with the path of your Microsoft Windows image.
hdiutil mount /example/windows.iso -mountpoint /Volumes/WINSETUP
11. Copy the Windows installation files to the USB flash drive, it might take a few minutes.
12. Unmount the USB flash drive.
diskutil unmountDisk /dev/disk2
When you download Windows from Microsoft Store, you have two options: You can download a collection of compressed files, or you can download an ISO file. An ISO file combines all the Windows installation files into a single uncompressed file.
If you choose to download an ISO file so you can create a bootable file from a DVD or USB drive, copy the Windows ISO file onto your drive and then run the Windows USB/DVD Download Tool. Then simply install Windows onto your computer directly from your USB or DVD drive.
When you download the ISO file, you must copy it onto a USB or DVD. When you're ready to install Windows, insert the USB drive or DVD with the ISO file on it and then run Setup.exe from the root folder on the drive.
This allows you to install Windows onto your machine without having to first run an existing operating system. If you change the boot order of drives in your computer's BIOS, you can run the Windows installation directly from your USB drive or DVD when you first turn on your computer. Please see the documentation for your computer for information about how to change the BIOS boot order of drives.
Making copies
- To install the software, you can make one copy of the ISO file on a disc, USB flash drive, or other media.
- After you’ve installed the software and accepted the license terms that accompany the software, those license terms apply to your use of the software. The license terms for Windows permit you to make one copy of the software as a back-up copy for re-installation on the licensed computer. If you do not delete your copy of the ISO file after installing the Windows software, the copy of the ISO file counts as your one back-up copy.
If you need to download the software again, you can go to your Download Purchase History in your Microsoft Store account and access the download there.