How to install from other OSes

Disclaimer

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.

Introduction

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).

Prerequisites

You need a copy of the Windows on Raspberry PE-based installer and the things required by it.

Also download:

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? :)

Getting the Windows image

See the Getting Windows images guide.

Preparing the installation media

1. Connect the drive that you wish to use for the installation media
2. Create the partition layout

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 /dev/sdb.
    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: /media/winpart.

3. Copy the installation files from the ISO image

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/isomount directory:

    ~/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
4. Copy the PE-based installer files

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)

Steps:

  • Extract the previously downloaded PE-based installer. We'll extract it to the ~/Downloads/peinstaller directory:
    ~/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.

  • Copy the files:
    ~/Downloads$ sudo cp -r peinstaller/efi /media/bootpart
    ~/Downloads$ sudo wimupdate /media/bootpart/sources/boot.wim 2 --command="add peinstaller/winpe/2 /"
5. Copy the drivers

The drivers must be copied to the /2/drivers directory of the WIM, where 2 is the index of the image.

Steps:

  • Extract the previously downloaded driver package. We'll extract it to the ~/Downloads/driverpackage directory:

    ~/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"
6. Copy the UEFI boot files

The UEFI boot files (without the directories) must be extracted to the root directory of the boot partition.

Steps:

  • Extract the previously downloaded UEFI package. We'll extract it to the ~/Downloads/uefipackage directory:

    ~/Downloads$ unzip RPi4_UEFI_Firmware_v1.28.zip -d uefipackage
  • Copy the UEFI files to the boot partition:

    ~/Downloads$ sudo cp uefipackage/* /media/bootpart
7. If you have a Raspberry Pi 2, 3 or CM3 (else skip this step)

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.

8. Unmount the drive and unplug it from your computer.
~$ sudo umount /dev/sdb?
9. Connect the drive and other peripherals to your Raspberry Pi then boot it up.

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).

If you have questions or issues

You can find answers to common questions / issues on our FAQ page.

If you can't find what you're looking for in the FAQ, you can use the Contact form, or even better, join the Discord / Telegram servers linked on our Community page.