Skip to content

Instantly share code, notes, and snippets.

@tkisason
Last active October 26, 2024 14:09
Show Gist options
  • Save tkisason/72adc9f1d107ee52b227a99f4ec53a7d to your computer and use it in GitHub Desktop.
Save tkisason/72adc9f1d107ee52b227a99f4ec53a7d to your computer and use it in GitHub Desktop.
Build an arm Win11 Pro ISO on Linux / MacOS without homebrew or other binaries

Build a arm Win11 Pro ISO on Linux / MacOS without homebrew or other binaries

This is a short guide on how to build a Win11 Pro ISO image on a linux vm and a macos machine running apple silicon. Such an ISO file can be used to install Win11 Pro on an Apple Silicon (m1 / m2) macbook under vmware. Yes, there are binaries, scripts and tools for this, but this guide only requires some linux tools and a plain macos machine without homebrew and without running some shady binaries downloaded from the Internet.

Download the Win11 product catalog in CAB from from: https://go.microsoft.com/fwlink?linkid=2156292

Unarchive the cab file, extract the products.xml file

To find your image, search by language first (English) then find the appropriate architecture (AARCH64).

Download the ESD file from the URL that's referened by the XML file

After that, you will need some tools in order to create the ISO image.

sudo apt install wimtools

Try to parse the ESD file:

wiminfo 22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd 

You will see about 6 images, first 3 elements are needed for boot (Windows Setup Media, Microsoft Windows PE (arm64), Microsoft Windows Setup (arm64)), lastly pick the forth one depending on which version you want to install (in my case, it was image #6: Windows 11 Pro)

Create a workdir, mine was called win11proiso

~ >  mkdir win11proiso

Start extracting the needed elements with wimapply.

Prepare the boot files:

~ > wimapply 22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd 1 win11proiso
[WARNING] Ignoring DOS names of 820 files
Applying image 1 ("Windows Setup Media") from "/home/user/22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd" to directory "win11proiso"
Extracting file data: 245 MiB of 245 MiB (100%) done
Done applying WIM image.

Create the boot.wim files containing the WinPE and the setup environment. Make sure that image #3 is marked as bootable:

~ > wimexport 22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd 2 win11proiso/sources/boot.wim --compress=LZX --chunk-size 32K  
Using LZX compression with 6 threads
Archiving file data: 1163 MiB of 1163 MiB (100%) done
wimexport  2 win11proiso/sources/boot.wim --compress=LZX --chunk-size 32K  84.89s user 0.53s system 445% cpu 19.193 total
~ > 
~ > wimexport 22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd 3 win11proiso/sources/boot.wim --compress=LZX --chunk-size 32K --boot
Using LZX compression with 6 threads
Archiving file data: 97 MiB of 97 MiB (100%) done

Add the install.wim file with the windows edition (here, i'm adding image 6, since that's Win11Pro as we found out with wiminfo):

~ > wimexport 22621.1702.230505-1222.ni_release_svc_refresh_CLIENTCONSUMER_RET_A64FRE_en-us.esd 6 win11proiso/sources/install.wim --compress=LZMS --chunk-size 128K     
Using LZMS compression with 1 thread
Archiving file data: 10 GiB of 10 GiB (100%) done

Review if you got the windows edition that you want:

~ > wiminfo win11proiso/sources/install.wim 
WIM Information:
----------------
Path:           win11proiso/sources/install.wim
GUID:           0xb236a7387df57925f49ebb5b06fc8659
Version:        3584
Image Count:    1
Compression:    LZMS
Chunk Size:     131072 bytes
Part Number:    1/1
Boot Index:     0
Size:           4209952256 bytes
Attributes:     Relative path junction

Available Images:
-----------------
Index:                  1
Name:                   Windows 11 Pro
Description:            Windows 11 Pro
Display Name:           Windows 11 Pro
Display Description:    Windows 11 Pro
Directory Count:        29053
File Count:             115567
Total Bytes:            20201508902
Hard Link Bytes:        9033174405
Creation Time:          Fri May 05 13:08:59 2023 UTC
Last Modification Time: Fri May 05 14:33:37 2023 UTC
Architecture:           ARM64
Product Name:           Microsoft® Windows® Operating System
Edition ID:             Professional
Installation Type:      Client
Product Type:           WinNT
Product Suite:          Terminal Server
Languages:              en-US 
Default Language:       en-US
System Root:            WINDOWS
Major Version:          10
Minor Version:          0
Build:                  22621
Service Pack Build:     1702
Service Pack Level:     0
Flags:                  Professional
WIMBoot compatible:     no

Ok, now we need to package this into a iso file that we can use to install win11 on vmware. To make a eltorito bootable image, we could try and use xorriso under linux, but macos hditool works also. copy the win11proiso to the mac (or just simply, move the shared folder somewhere where you can package the image with hdiutil):

~/tmp > hdiutil makehybrid -help
hdiutil makehybrid: generate cross-platform hybrid images

Generate the hybrid bootable image:

~/tmp > hdiutil makehybrid -o win11pro-aarch64.iso -iso -udf -hard-disk-boot -eltorito-boot ./win11proiso/efi/microsoft/boot/efisys.bin  ./win11proiso
Creating hybrid image...
..................................................................................................................................................................................................................................................

Now we have a bootable iso:

~/tmp > ls -alh win11pro-aarch64.iso
-rw-r--r--  1 tony  staff   4.6G May 18 12:26 win11pro-aarch64.iso

Load that up in vmware fusion, and install windows 11 pro. make sure to:

  • Select the EFI Secure Boot option
  • If the installer asks you to setup an virtualized Encrypted TPM, that means you are on the right track, select "Only files needed to support TPM", autogenerate the TPM password and store it in mac's keychain. Or remember it, depends on your wanted level of security / privacy. Fusion autounlocks VM's that have a keychain stored password.
  • Up the cpu count / memory / disk for the VM, at least 2cores, 8Gb ram and at least 64GB HDD. If you have a more powerful computer, consider giving the VM more space. (6 cores, 16Gb ram and 200 GB HDD)
  • Install windows 11

When Win11 boots, at some point you will need network connectivity which you don't have. Open the Virtual Machine menu in vmware, select "Install VMware Tools". After the CD mounts, press Shift+Fn+F10 to open a cmd shell, type:

> powershell
> cd d:
> Set-ExecutionPolicy RemoteSigned
> .\setup.ps1

This will install the vmware network driver, you can continue installation as usual.

After that, Win11 will force you to enroll with either AD or a microsoft account. To skip this:

  • Disable the network interface in vm settings.
  • Open the cmd shell with Shift+Fn+F10, and type:
oobe\bypassnro

The vm will jump back to the configuration steps, select your region, keyboard layout, etc. When you come to the network setup, select "I don't have internet" When you get to the "Connect now" page, select "Continue with limited setup" Continue install as normal. Reboot into win11 and enable the network adapter in the vm settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment