Personally, I prefer installing operating systems from a USB stick, so here's a tutorial
If you already have some idea of what's going on:
- Download the ISO from Microsoft - https://www.microsoft.com/en-ca/software-download/windows11
- Erase USB device and format in
MS-DOS/FAT32
diskutil eraseDisk MS-DOS "WINDOWS11" MBR /dev/diskX
- Copy all files over to the USB device except
install.wim
rsync -vha --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS11
- Split up the
install.wim
file into FAT32 sized chunks (trywimlib
)
wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WINDOWS11/sources/install.swm 3800
You can download the official ISO file from Microsoft directly
currently found here - https://www.microsoft.com/en-ca/software-download/windows11
As a brief primer - the .iso
extension represents a disk image. In this case, it contains a collection of data/files that are required to "boot" the Windows 11 OS.
Once you've downloaded the file (probably looks something like this - Win11_22H2_English_x64v2.iso
) you want to open it up. If you take a look inside (using du - Disk Usage
), you'll see that the largest file is under /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources
bocchi@hitorilabs ~ $ du -hs /Volumes/CCCOMA_X64FRE_EN-US_DV9/*
2.0K /Volumes/CCCOMA_X64FRE_EN-US_DV9/autorun.inf
18M /Volumes/CCCOMA_X64FRE_EN-US_DV9/boot
432K /Volumes/CCCOMA_X64FRE_EN-US_DV9/bootmgr
2.4M /Volumes/CCCOMA_X64FRE_EN-US_DV9/bootmgr.efi
23M /Volumes/CCCOMA_X64FRE_EN-US_DV9/efi
94K /Volumes/CCCOMA_X64FRE_EN-US_DV9/setup.exe
5.4G /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources
448K /Volumes/CCCOMA_X64FRE_EN-US_DV9/support
Look inside that sources
directory and see that there's a huge file install.wim
that contains the main contents of Windows 11.
bocchi@hitorilabs ~ $ du -hs /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/* | grep install.wim
4.7G /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim
Note: .wim
is an extension representing a "Windows Image" file which is some compressed representation of the data.
First, check for the location of the USB we plugged in using diskutil
.
You will see something like this:
bocchi@hitorilabs ~ $ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
...
/dev/disk3 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +994.7 GB disk3
...
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *30.8 GB disk4
1: DOS_FAT_32 WINDOWS11 30.8 GB disk4s1
/dev/disk5 (disk image):
#: TYPE NAME SIZE IDENTIFIER
0: CCCOMA_X64FRE_EN-US... +5.8 GB disk5
It's obvious here that /dev/disk4
ended up being my USB device since I already have Windows 11 installed and formatted, but you want to make sure you know which device is actually your USB so that you don't accidentally wipe your own system.
You can pretty much expect that devices /dev/disk{1..3}
are all internal and the next ones are external disks - otherwise, it's usually easy to tell just by the SIZE
of your USB storage. (i.e. /dev/disk5
is the .iso
file or "disk image" you opened up earlier now visible under/Volumes/CCCOMA_X64FRE_EN-US_DV9
)
In order to make a bootable drive, the USB device should be formatted in FAT32/MS-DOS by running the following command:
bocchi@hitorilabs ~ $ diskutil eraseDisk MS-DOS "WINDOWS11" MBR /dev/disk4
For some definitions of options we're specifying:
MBR
(Master Boot Record) - https://en.wikipedia.org/wiki/Master_boot_recordMS-DOS
/FAT32
(File Allocation Table) - https://en.wikipedia.org/wiki/File_Allocation_Table"WINDOWS11"
- friendly name to identify our device
From the wiki page about FAT32, you'll see
The maximal possible size for a file on a FAT32 volume is 4 GB minus 1 byte, or 4,294,967,295 (232 − 1) bytes.
Unfortunately, we can't just dump the contents of the .iso
file directly into this device yet because of the 4.7GB install.wim
file. (no idea why they would ship the files over like this if they knew this would happen)
For now, we're going to copy every file from the ISO file /Volumes/CCCOMA_X64FRE_EN-US_DV9
over to /Volumes/WINDOWS11
except for install.wim
(I prefer to use rsync
)
bocchi@hitorilabs ~ $ rsync -vha --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS11
It's pretty standard on macos
to have homebrew
installed. If you don't already have it, install it at https://brew.sh.
Since most people probably never looked into the .wim
Windows Image file format, we're going to use a tool off the shelf called wimlib
to do the splitting.
brew install wimlib
Here we're splitting the file from /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim
into 3.8GB chunks (to fit comfortably under MS-DOS
/FAT32
limits) into the device location /Volumes/WINDOWS11/sources/install.swm
bocchi@hitorilabs ~ $ wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WINDOWS11/sources/install.swm 3800
Now you're actually done - that's all there is to it. Unmount the USB device and it should be detected as a bootable device in the UEFI/BIOS of your PC.
Normally, I wouldn't make a tutorial like this because anyone who's clicking on gists and knows their way around a shell environment probably doesn't need that much hand-holding - but I found it surprisingly difficult for someone who has some technical understanding.
Creating a bootable USB for a linux operating system is trivial if you've ever gone through the arch wiki (https://wiki.archlinux.org/title/USB_flash_installation_medium), but the same cannot be said for this.
I forked the original guide because:
install.wim
goes over the FAT32 limit - ExFAT is usually not bootable