This guide and software presented here are provided "as is", without warranty of any kind. We're not responsible for any damage caused to your devices by following the steps below.
The most straightforward way to install WoR from a non-Windows environment is by using a virtual machine, and passing through the destination drive to it. If you want to do just that, the guide ends here for you.
This may not always be feasible, so we've came up with another method: prepare a Windows Preinstallation Environment (WinPE) media that's capable of deploying Windows on itself (or on a secondary drive).
Why is this needed in the first place? Isn't it possible to run the WoR imager in Wine, like any other Windows-only application?
The imager has dependencies that are not available / don't work on Wine, notably: DISM (/Add-Driver), bcdboot and bcdedit.
We'll be using Linux (Ubuntu 21.04) in this guide to demonstrate the steps required, but you can perform them on macOS and possibly other OSes too. The partitioning tools & such may be different, so you'll need to adjust the commands accordingly (a web search engine will help you along the way).
You need a copy of the Windows on Raspberry PE-based installer and the things required by it.
If you're using a Raspberry Pi 4, you must update the bootloader to the latest version: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md
Oh, you also need some basic knowledge of the OS that you're using: copying files, extracting archives, installing missing tools/packages, etc. Again, plenty of info available on the internet. We can't cover every distro in the world, can we? :)
See the Getting Windows images guide.
The disk must be GPT-partitioned, with one of the following layouts:
if you want the installer to be able to install Windows on the same drive (assuming it has the minimum space required):
Number File system Type Size 1 FAT32 Basic Data Partition 1 GB 2 exFAT or NTFS Basic Data Partition 18 GB 3 Unallocated space the rest of the disk
if your drive doesn't have enough space for the layout above, you can create an installation media that's able to install Windows on other drives (like a regular Windows installation ISO) (this must also meet the according minimum space requirements):
Number File system Type Size 1 FAT32 Basic Data Partition 1 GB 2 exFAT or NTFS Basic Data Partition all space available on the disk
Our drive has plenty of space available, so we'll go with the first method:
Find your drive's path:
~$ sudo parted -l
Model: ATA VBOX HARDDISK (scsi) Disk /dev/sda: 54,5GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 2097kB 1049kB bios_grub 2 2097kB 540MB 538MB fat32 EFI System Partition boot, esp 3 540MB 54,5GB 54,0GB ext4 Model: ADATA SD600Q (scsi) Disk /dev/sdb: 240GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 135MB 134MB fat32 Basic data partition boot, esp 2 135MB 152MB 16,8MB Microsoft reserved partition msftres 3 152MB 240GB 240GB ntfs Basic data partition msftdata
We'll choose the
ADATA SD600Q (scsi) USB drive which can be found on
Replace all occurrences of
/dev/sdb with the path of your drive.
Double-check the drive before continuing! The commands below will erase the data on it! You have been warned.
Unmount all the mount points on the drive, if any:
~$ sudo umount /dev/sdb?
Create the GPT:
~$ sudo parted -s /dev/sdb mklabel gpt
Create the Boot partition:
~$ sudo parted -s /dev/sdb mkpart primary 1MB 1000MB ~$ sudo parted -s /dev/sdb set 1 msftdata on
Create the Windows partition:
~$ sudo parted -s /dev/sdb mkpart primary 1000MB 19000MB ~$ sudo parted -s /dev/sdb set 2 msftdata on
1MB = partition boundary (it's the default alignment in most cases, but we need to specify it in parted)
msftdata = Basic Data Partition flag, required
Format the partitions created above:
~$ sudo mkfs.fat -F 32 /dev/sdb1 ~$ sudo mkfs.exfat /dev/sdb2 **OR** sudo mkfs.ntfs -f /dev/sdb2
Mount the partitions:
~$ sudo mkdir -p /media/bootpart /media/winpart ~$ sudo mount /dev/sdb1 /media/bootpart ~$ sudo mount /dev/sdb2 /media/winpart
The Boot partition can be found in:
/media/bootpart, and the Windows one in:
The following directories and files must be copied from the ISO:
ISO -> Destination ----------------------------------------------------------------------------- boot Boot-Partition/boot efi Boot-Partition/efi sources/boot.wim Boot-Partition/sources/boot.wim sources/install.wim (or .esd) Windows-Partition/install.wim (or .esd)
Let's do that:
Go to the directory where you've extracted the ISO:
~$ cd ~/Downloads/21390_uupdump
~ (tilde) is equivalent to your user home directory.
Mount the ISO image. We'll mount it in the
~/Downloads/21390_uupdump$ mkdir -p isomount ~/Downloads/21390_uupdump$ sudo mount 21390.1_PROFESSIONAL_ARM64_EN-US.ISO isomount
Copy the files:
~/Downloads/21390_uupdump$ sudo cp -r isomount/boot /media/bootpart ~/Downloads/21390_uupdump$ sudo cp -r isomount/efi /media/bootpart ~/Downloads/21390_uupdump$ sudo mkdir /media/bootpart/sources ~/Downloads/21390_uupdump$ sudo cp isomount/sources/boot.wim /media/bootpart/sources ~/Downloads/21390_uupdump$ sudo cp isomount/sources/install.wim /media/winpart
We can now unmount the ISO:
~/Downloads/21390_uupdump$ sudo umount isomount
The following directories must be copied from the PE-based installer package:
WoR-PE_Package -> Destination ----------------------------------------------------------------- efi Boot-Partition/efi winpe/2 Boot-Partition/sources/boot.wim/2 (index 2 of the WIM)
~/Downloads$ unzip WoR-PE_Package_1.0.0.zip -d peinstaller
For the following steps we'll need wimupdate from the wimtools package. If you've created the ISO using UUPDump, then you already have it installed.
7-Zip can also edit WIM files.
~/Downloads$ sudo cp -r peinstaller/efi /media/bootpart ~/Downloads$ sudo wimupdate /media/bootpart/sources/boot.wim 2 --command="add peinstaller/winpe/2 /"
The drivers must be copied to the
/2/drivers directory of the WIM, where
2 is the index of the image.
Extract the previously downloaded driver package. We'll extract it to the
~/Downloads$ unzip RPi4_Windows_ARM64_Drivers_v0.10.zip -d driverpackage
Copy the drivers to the WIM:
~/Downloads$ sudo wimupdate /media/bootpart/sources/boot.wim 2 --command="add driverpackage /drivers"
The UEFI boot files (without the directories) must be extracted to the root directory of the boot partition.
Extract the previously downloaded UEFI package. We'll extract it to the
~/Downloads$ unzip RPi4_UEFI_Firmware_v1.28.zip -d uefipackage
Copy the UEFI files to the boot partition:
~/Downloads$ sudo cp uefipackage/* /media/bootpart
Old boards don't natively support GPT boot, so a workaround is required: apply the
pi3/gptpatch.img image from the PE-based installer package to your drive.
~/Downloads$ sudo dd if=peinstaller/pi3/gptpatch.img of=/dev/sdb conv=fsync
Some tools may format the disk before applying the raw image. This must not happen, so we recommend using dd or gddrescue.
~$ sudo umount /dev/sdb?
Assuming everything went right in the previous steps, you'll be further guided by the PE-based installer on your Pi.
If you've used the first method (self-installation) at the 2. Create the partition layout step, there's no need to touch the Raspberry Pi once it has booted. The installer will automatically start the installation process after a delay of 15 seconds. Moving the mouse cursor over the Windows Setup window will stop the timer, so you'll have to manually click on the Install button.
If you've used the second method (install on a secondary drive), you must also connect the 2nd drive before the installer window opens up, then select it in the drop-down list. Otherwise it will assume you're trying to install Windows on the same drive (self-installation).
You can find answers to common questions / issues on our FAQ page.