Apple - How to create a Windows 10 bootable USB on a Mac for PC without Bootcamp, when install.wim is too large
The open-source package called wimlib, can also "optimize" a wim file. I managed to reduce the size bellow 4Go, my FAT32 usb thumb accepted it, and booted with success
Install wimlib via brew
brew install wimlib
Copie the bigfile from the iso volume to your HD Disk (Download example by example)
cp /Volumes/CCC.../sources/install.wim install.wim
Compress the file
wimlib-imagex optimize install.wim --solid
"install.wim" original size: 4463411 KiB
Using LZMS compression with 8 threads
Archiving file data: 9 GiB of 9 GiB (100%) done
"install.wim" optimized size: 3311533 KiB
Space saved: 1151878 KiB
You may need sudo, because you could encounter an error like this:
[ERROR] Can't modify "/home/roger/win/sources/install.wim": Permission denied
ERROR: Exiting with error code 71:
The WIM is read-only (file permissions, header flag, or split WIM).
Copy the reduced file to your usb drive
cp install.wim /Volumes/MYUSB/sources/install.wim
Boot up !
So, I needed to use FAT32 for my BIOS to accept it, but both the April 2018 and October 2018 updates had an install.wim
file that was over 4 GB (I downloaded the English international version for both, maybe other versions are different?). So I needed to split the file. Here is how I did it for anyone else who has this problem.
I found this amazing guide for it (https://www.tenforums.com/tutorials/103340-dism-split-install-wim-file.html), but it was for Windows so I had to adapt it. I used split terminal command to split the install.wim
file.
split -b 3700m /Volumes/CCCOMA_X64FRE_EN-GB_DV9/sources/install.wim install.wim
This creates install.wimaa
and install.wimab
. I then moved all the ISO files to the FAT32 USB, but with the new install.wim
files. This time, when I booted from the USB, I get the Windows boot media, but it obviously cannot find install.wim
. So I go to the command prompt and follow the guide and type out the diskpart
commands it says (I followed MBR).
After that, I copied the contents of the USB drive to the Windows 10 volume that I created from the guide (I think I used xcopy
, but there's other commands for it). Navigated to that volume, went to the sources folder and typed the commands:
type install.wimaa install.wimab > install.wim
(Once that finished, I deleted the old wimaa
and wimab
files)
del install.wimaa
del install.wimab
After this I followed the rest of the guide, applied the image, add boot records (The disk volumes for me were different than what the guide should have given me, but that might have been a mistake on my part) and booted my pc back up after removing the USB. If it says operating system not found, this worked for me: https://www.wintips.org/fix-operating-system-was-n0t-found-error-on-windows-10-8-solved/.
This was so complicated for some reason and took me many hours to figure out.
I found the only way for me to make it work was installing windows on VirtualBox, and then use Rufus in the virtual machine to create the bootable usb drive. A bit tedious but it works.