8

The Windows 11 ISO file, which can be downloaded from Microsoft, contains a install.wim file that is greater than 4 GiB in size. This prevents creating a USB flash drive installer by simply copying the files from the mounted Windows 11 ISO file to a FAT32 formatted USB flash drive.

If you have a machine running Windows, this is not a problem because you can download and run the mediacreationtool.exe file, which can create either a USB flash drive installer or Windows 11 ISO file. In this case, an install.esd file is substituted for the install.wim file. This install.esd file is less that 4 GiB in size and therefore will fit a FAT32 formatted volume.

However, I am use macOS which cannot execute the mediacreationtool.exe file. I am looking for a solution that can be used to create an USB Windows 11 flash drive installer. I would prefer a solution that does not involve using third party tools.

Giacomo1968
  • 58,727

3 Answers3

10

This answer is summarized below.

  • MBR partition a 16 GB or larger flash drive to contain a FAT32 volume and an ExFAT volume.
  • Copy all the files, except sources/install.wim, from the mounted Windows ISO file to the FAT32 volume on the flash drive.
  • Copy sources/install.wim from the mounted Windows ISO file to the ExFAT volume on the flash drive.
  • Boot from the flash drive and enter a command to split the install.wim on the ExFAT volume to two files placed on the FAT32 volume.
  • The result is an USB flash drive which can be used to install Windows 11.

The steps are given next.

  1. Goto Microsoft's Download Windows 11 website and download the Windows 11 disk image (ISO) for x64 devices. In my case, the Win11_24H2_English_x64.iso file was downloaded to my Downloads folder. If your file name is different, then make the appropriate substitutions when entering the commands below.

    Insert a 16 GB or larger flash drive in an USB port on or connected to the Mac.

  2. Open a Terminal application window.

    Use the command below to determine the identifier for the USB flash drive. I my case, this was disk2. If your identifier is different, the make the appropriate substitutions in the following commands.

    diskutil list external
    

    Enter the command below to format the flash drive.

    diskutil partitiondisk disk2 mbr fat32 MYFAT32 8G exfat MyExFAT R
    

    Enter the command below to remove all extended attributes from the Windows ISO file. This will remove the quarantine placed on the file when it was downloaded.

    xattr -c ~/Downloads/Win11_24H2_English_x64.iso
    

    Enter the command below to mount the Windows 11 ISO file. In my case, the output from the command shows the file was mounted on /Volumes/CCCOMA_X64FRE_EN-US_DV9. If your folder name is different, then make the appropriate substitutions when entering the commands below.

    hdiutil attach ~/Downloads/Win11_24H2_English_x64.iso
    

    Enter the command below to change the current directory to /Volumes/CCCOMA_X64FRE_EN-US_DV9.

    cd /Volumes/CCCOMA_X64FRE_EN-US_DV9
    

    Enter the commands below to copy the files from the mounted ISO to the flash drive. Note: Since the install.wim file is very large, the cp command can take a while to complete.

    rsync -r -t --exclude=sources/install.wim . /Volumes/MYFAT32
    cp sources/install.wim /Volumes/MyExFAT
    

    Enter the commands below to unmount the Windows 11 ISO file.

    cd ~
    hdiutil detach /Volumes/CCCOMA_X64FRE_EN-US_DV9 
    

    Enter the command below to eject the flash drive. Afterwards, you can remove the flash drive.

    diskutil eject disk2
    

    You can quit the Terminal application.

  3. Using the computer where Windows is to be installed, UEFI boot from the flash drive. You should get a window similar to the one shown below. You can ignore the contents of this window.

    install drivers

  4. Press the shift+F10 key combination to open Command Prompt window.

    Enter the command below. From the output, determine the drive letters for the MYFAT32 and MyExFAT volumes. In my case, the was C and D respectively. If your letters are different, the make the appropriate substitutions for c:\ and d:\ when entering the dism command given below.

    echo list volume | diskpart
    

    Enter the command below to create the install.swm and install2.swm files in the c:\sources folder. Note: This command will take a while to complete.

    dism /split-image /imagefile:d:\install.wim /swmfile:c:\sources\install.swm /filesize:4000
    

    Enter the command below to close the Command Prompt window.

    exit
    
  5. Close the window. When the popup shown below appears, select "Yes". The computer will reboot.

    popup

    The next time you UEFI boot from this USB flash drive, you should encounter the following window. You then can proceed and install Windows 11.

    Select language settings


Example of Using the Terminal Window

Last login: Sun Mar  9 09:16:57 on console
davidanderson@Davids-Mac ~ % diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *15.9 GB    disk2
   1:                 DOS_FAT_32 ⁨MYFLASHDRV⁩              15.9 GB    disk2s1

davidanderson@Davids-Mac ~ % diskutil partitiondisk disk2 mbr fat32 MYFAT32 8G exfat MyExFAT R Started partitioning on disk2 Unmounting disk Creating the partition map Waiting for partitions to activate Formatting disk2s1 as MS-DOS (FAT32) with name MYFAT32 512 bytes per physical sector /dev/rdisk2s1: 15594504 sectors in 1949313 FAT32 clusters (4096 bytes/cluster) bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2048 drv=0x80 bsec=15625000 bspf=15230 rdcl=2 infs=1 bkbs=6 Mounting disk Formatting disk2s2 as ExFAT with name MyExFAT Volume name : MyExFAT Partition offset : 15628288 sectors (8001683456 bytes) Volume size : 15370240 sectors (7869562880 bytes) Bytes per sector : 512 Bytes per cluster: 32768 FAT offset : 2048 sectors (1048576 bytes)

FAT sectors : 2048

Number of FATs : 1 Cluster offset : 4096 sectors (2097152 bytes)

Clusters : 240096

Volume Serial # : 67cdc143 Bitmap start : 2 Bitmap file size : 30012 Upcase start : 3 Upcase file size : 5836 Root start : 4 Mounting disk Finished partitioning on disk2 davidanderson@Davids-Mac ~ % xattr -c ~/Downloads/Win11_24H2_English_x64.iso davidanderson@Davids-Mac ~ % hdiutil attach ~/Downloads/Win11_24H2_English_x64.iso /dev/disk3 /Volumes/CCCOMA_X64FRE_EN-US_DV9 davidanderson@Davids-Mac ~ % cd /Volumes/CCCOMA_X64FRE_EN-US_DV9 davidanderson@Davids-Mac CCCOMA_X64FRE_EN-US_DV9 % rsync -r -t --exclude=sources/install.wim . /Volumes/MYFAT32 davidanderson@Davids-Mac CCCOMA_X64FRE_EN-US_DV9 % cp sources/install.wim /Volumes/MyExFAT davidanderson@Davids-Mac CCCOMA_X64FRE_EN-US_DV9 % cd ~ davidanderson@Davids-Mac ~ % hdiutil detach /Volumes/CCCOMA_X64FRE_EN-US_DV9 "disk3" ejected. davidanderson@Davids-Mac ~ % diskutil eject disk2 Disk disk2 ejected davidanderson@Davids-Mac ~ %


Example of Using the Command Prompt Window

Microsoft Windows [Version 10.0.26100.1742]
(c) Microsoft Corporation. All rights reserved.

X:\sources>echo list volume | diskpart

Microsoft DiskPart version 10.0.26100.1150

Copyright (C) Microsoft Corporation. On computer: MININT-NBNQP5I

DISKPART> Volume ### Ltr Label Fs Type Size Status Info


Volume 0 E DVD-ROM 0 B No Media Volume 1 C MYFAT32 FAT32 Removable 7629 MB Healthy Volume 2 D MyExFAT exFAT Removable 7505 MB Healthy

DISKPART> X:\sources>dism /split-image /imagefile:d:\install.wim /swmfile:c:\sources\install.swm /filesize=4000

Deployment Image Servicing and Management tool Version: 10.0.26100.1150

The operation completed successfully.

X:\sources>exit

2

User Dan Is Fiddling By Firelight posted the following comment.

I'm leaving this as a comment since without access to a Mac I don't feel I could write a complete answer. Instead of directly creating a bootable windows installer USB, create a Ventoy bootable USB. Once you do that you can copy bootable drive images in all the major formats on as ordinary files, and then start them from a basic menu system that Ventoy shows when it boots. It's slightly more work the first time, but as long as you don't reformat the USB it'll make any future uses much easier since it reduces the operation to a simple copy/paste. ventoy.net/en/index.html

I decided to post this answer in response to the above comment. Note that the question does not explicitly rule out posting a solution which uses third party tools.

This answer is summarized below.

  • Download Ventoy live CD image (ISO) file, then copy this file to an 8 GB or larger flash drive.
  • Boot from the flash drive and install Ventoy to the same flash drive.
  • Download the Windows 11 ISO file and copy to the flash drive.
  • Boot from the flash drive and install Windows 11. If necessary, first enroll the key in MOK manager.

The steps are given next.

  1. Goto SourceForge's Ventoy project files website and download the Ventoy live CD image (ISO) for x64 devices. In my case, the ventoy-1.1.05-livecd.iso file was downloaded to my Downloads folder. If your file name is different, then make the appropriate substitutions when entering the commands below.

    Insert an 8 GB or larger flash drive in an USB port on or connected to the Mac.

  2. Open a Terminal application window.

    Enter the command below to remove all extended attributes from the Ventoy live CD image (ISO) file. This will remove the quarantine placed on the file when it was downloaded.

    xattr -c ~/Downloads/ventoy-1.1.05-livecd.iso
    

    Use the command below to determine the identifier for the USB flash drive. I my case, this was disk2. If your identifier is different, the make the appropriate substitutions in the following commands.

    diskutil list external
    

    Enter the commands below to copy the Ventoy live CD image (ISO) file to the flash drive. Note: Using rdisk2 instead of disk2 usually results in a quicker copy.

    diskutil unmountdisk disk2
    sudo dd if=$HOME/Downloads/ventoy-1.1.05-livecd.iso bs=1m of=/dev/rdisk2
    

    Enter the command below to eject the flash drive. Afterwards, you can remove the flash drive.

    diskutil eject disk2
    
  3. Using the computer where Windows is to be installed, UEFI boot from the flash drive.

    Note
    You will need to disable Secure Boot.

    When the following Grub menu appeared, I choose the first entry, which is the default.

    Grub

    Ventoy2Disk is loading completely into RAM disk. This allows the flash drive to be overwritten. In my case, to install to the same flash drive, I just needed to select "Install" button shown below, then the "OK" button in the following popups.

    Before install

    After installation to the flash drive has successfully completed, the following is displayed.

    After install

    At this point, either manually shutdown the computer or reboot by closing the window. If you choose to reboot and are successful, then the following will appear.

    After reboot

    Shutdown the computer by pressing the F5 key, then selecting "Power" and finally selecting "Halt".

    Remove the flash drive.

  4. Goto Microsoft's Download Windows 11 website and download the Windows 11 disk image (ISO) for x64 devices. In my case, the Win11_24H2_English_x64.iso file was downloaded to my Downloads folder. If your file name is different, then make the appropriate substitutions when entering the commands below.

    Insert the same flash drive in an USB port on or connected to the Mac.

  5. Use the same or a new Terminal application window to enter the following commands.

    Enter the command below to remove all extended attributes from the Windows ISO file. This will remove the quarantine placed on the file when it was downloaded.

    xattr -c ~/Downloads/Win11_24H2_English_x64.iso
    

    Use the command below to determine the identifier for the USB flash drive. I my case, this was disk2. If your identifier is different, the make the appropriate substitutions in the following commands.

    diskutil list external
    

    Enter the command below to copy the Windows ISO file to the ExFAT formatted volume named Ventoy on the flash drive.

    cp ~/Downloads/Win11_24H2_English_x64.iso /Volumes/Ventoy
    

    Enter the command below to eject the flash drive. Afterwards, you can remove the flash drive.

    diskutil eject disk2
    
  6. If necessary, enroll key in MOK manager as described in this step.

    Using the computer where Windows is to be installed, UEFI boot from the flash drive.

    Note
    You should have Secure Boot enabled before UEFI booting from the flash drive.

    If you encounter the following display, select OK, otherwise proceed to the step 7.

    Verification failed

    The next display should appear as shown below. Before the timer expires, press any key.

    Press any key to perform MOK management

    Select Enroll key from disk, as shown below.

    Enroll key from disk

    Select VTOYEFI, as shown below.

    VTOYEFI

    Select ENROOL_THIS_KEY_IN_MOKMANAGER.cer, as shown below.

    ENROOL_THIS_KEY_IN_MOKMANAGER.cer

    Select Continue, as shown below.

    Continue

    Select Yes, as shown below.

    Yes

    Select Reboot, as shown below.

    Reboot

  7. Install Windows 11.

    If you have not already done so, UEFI boot the computer where Windows is to be installed from the flash drive.

    Note
    You should have Secure Boot enabled before UEFI booting from the flash drive.

    When the display below appears, press the F5 key.

    Win11_24H2_English_x64.iso

    Select Temporary Control Settings, as shown below.

    Temporary Control Settings

    This answer assume Windows 11 is being installed on supported hardware. Normally, when booting from the Windows 11 installer, the following would be set to 0, as shown in the image below. You need to decided whether the following need to be set to 0 or 1.

    • Bypass CPU/TPM/SecureBoot check when installing Windows 11 This allows includes bypassing the 4 GB RAM check.
    • Bypass online account requirement when installing Windows 11

    When finished, press the esckey twice.

    Bypass

    Select Win11_24H2_English_x64.iso, as shown below.

    Win11_24H2_English_x64.iso

    Select Boot in normal mode, as shown below.

    Note
    When message Press any key to boot from CD or DVD. appears, you may need to press any key.

    Boot in normal mode

    When the display shown below appears, proceed with the installation of Windows 11.

    Select language settings


Example of Using the Terminal Window

Last login: Thu Mar 13 17:46:02 on ttys001
davidanderson@Davids-Mac ~ % xattr -c ~/Downloads/ventoy-1.1.05-livecd.iso
davidanderson@Davids-Mac ~ % diskutil list external
/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *15.9 GB    disk2
   1:                 DOS_FAT_32 MYFLASHDRV              15.9 GB    disk2s1

davidanderson@Davids-Mac ~ % diskutil unmountdisk disk2
Unmount of all volumes on disk2 was successful davidanderson@Davids-Mac ~ % sudo dd if=$HOME/Downloads/ventoy-1.1.05-livecd.iso bs=1m of=/dev/rdisk2 186+1 records in 186+1 records out 195702784 bytes transferred in 4.038241 secs (48462383 bytes/sec) davidanderson@Davids-Mac ~ % diskutil eject disk2 Disk disk2 ejected davidanderson@Davids-Mac ~ % xattr -c ~/Downloads/Win11_24H2_English_x64.iso davidanderson@Davids-Mac ~ % diskutil list external /dev/disk2 (external, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *15.9 GB disk2 1: Windows_NTFS Ventoy 15.8 GB disk2s1 2: 0xEF 33.6 MB disk2s2

davidanderson@Davids-Mac ~ % cp ~/Downloads/Win11_24H2_English_x64.iso /Volumes/Ventoy davidanderson@Davids-Mac ~ % diskutil eject disk2 Disk disk2 ejected davidanderson@Davids-Mac ~ %

0

This should be possible using the Boot Camp Assistant app on the Mac. Start the process. Insert your USB drive. Make sure to check Create a Windows Install Disk. Then you it will ask you for the Windows ISO. When it is finished copying to the USB drive you can cancel the process.