Skip to content

Instantly share code, notes, and snippets.

@caccialdo
Last active October 28, 2024 22:01
Show Gist options
  • Save caccialdo/3b0d0113489ecee456d94c1e9462d755 to your computer and use it in GitHub Desktop.
Save caccialdo/3b0d0113489ecee456d94c1e9462d755 to your computer and use it in GitHub Desktop.
How to reinstall Windows 11 Home on a Snapdragon X Elite device

How to reinstall Windows 11 Home on a Snapdragon X Elite device

Note
As of June 2024, Snapdragon X Elite devices are still very new and support for installations of Windows on ARM by the consumers is not (yet) as straight forward as "burning" an ISO file supplied by Microsoft onto a USB drive like for their x86 counterparts. Currently, the only way to get a USB device to boot is to use an EFI partition created with diskpart or a WinPE boot drive.

What you’ll need

  • A machine that is up and running - on Windows preferably but a Windows VM in macOS or linux is also fine.

  • A USB hub with enough ports to plug all the devices below.

  • 2x USB sticks (one for WinPE and one to store the installation files).

  • A wired mouse or one using a USB dongle since the trackpad won’t be working during installation.

  • An ethernet adapter to provide internet access to the machine and download the device drivers (including those for the wifi controller and the trackpad).

Installation steps

1. Create a WinPE boot device

From a Windows device,

  1. Install Windows Assessment and Deployment Kit (Windows ADK) and Windows PE add-on (official guide, as of June 2024)

  2. Launch the "Deployment and Imaging Tools Environment" app with administrator privileges

  3. Run the following commands one by one:

    cd "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\arm64"
    copype arm64 C:\WinPE_arm64
    Dism /Mount-Image /ImageFile:"en-us\winpe.wim" /index:1 /MountDir:"C:\WinPE_arm64\mount"
    MakeWinPEMedia /ISO C:\WinPE_arm64 C:\WinPE_arm64.iso
    Dism /Unmount-Image /MountDir:"C:\WinPE_arm64\mount" /commit

The WinPE ISO should now be available at C:\WinPE_arm64.iso.

You can now simply use Rufus to "burn" the ISO file to a USB drive.

2. Create a Windows for ARM 11 24H2 (or newer) ISO file

Note
It appears that only recent versions of Windows on ARM 11 (24H2, as of June 2024), will allow the installation process to work. Make sure to keep that in mind when selecting the revision of Windows in the next steps.

There are many ways to achieve this outcome. If you have access to a macOS device, I’d suggest using the open source CrystalFetch app which will generate an ISO file from official ESD files downloaded from Microsoft servers. Otherwise, simply use a script from UUP dump to generate the ISO file.

3. Retrieve the install.win file from a Windows on ARM installation ISO file

  1. Mount the ISO file and locate the install.wim file. For me, that file lived at /sources/install.wim. The file should be quite large (4+GB). If yours is nowhere near as large, you’re probably using the wrong WIM file.

  2. Format the other USB drive (not the one used by WinPE) as NTFS.

  3. Copy the install.wim file to that newly formatted drive. Anywhere will do but the root will make scripts listed next work out-of-the-box.

4. Create the installation scripts

Original code from Microsoft (1, 2). Those guide were written in 2014 and a couple tweak were necessary to make them work with Windows 11 in 2024.

  1. Create a new file called CreatePartitions.txt next to the install.wim with the following content:

    rem == CreatePartitions-UEFI.txt ==
    rem == These commands are used with DiskPart to
    rem    create five partitions
    rem    for a UEFI/GPT-based PC.
    rem    Adjust the partition sizes to fill the drive
    rem    as necessary. ==
    
    select disk 0
    clean
    convert gpt
    
    rem == 1. Windows RE tools partition ===============
    create partition primary size=600
    format quick fs=ntfs label="Windows RE tools"
    assign letter="T"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    gpt attributes=0x8000000000000001
    
    rem == 2. System partition =========================
    create partition efi size=260
    format quick fs=fat32 label="System"
    assign letter="S"
    
    rem == 3. Microsoft Reserved (MSR) partition =======
    create partition msr size=128
    
    rem == 4. Windows partition ========================
    rem ==    a. Create the Windows partition ==========
    create partition primary
    rem ==    b. Create space for the recovery image ===
    shrink minimum=15000
    rem ==    c. Prepare the Windows partition =========
    format quick fs=ntfs label="Windows"
    assign letter="W"
    
    rem === 5. Recovery image partition ================
    create partition primary
    format quick fs=ntfs label="Recovery image"
    assign letter="R"
    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
    gpt attributes=0x8000000000000001
    
    list volume
    exit
  2. Create a new file called ApplyImage.bat next to the install.wim with the following content:

    rem These commands copy the selected image file to
    rem predefined hard disk partitions on a UEFI-based computer.
    rem Usage:   ApplyImage WimFileName
    rem Example: ApplyImage E:\Images\ThinImage.wim
    
    rem === Copy the image to the recovery image partition =======================
    copy %1 R:\install.wim
    
    rem === Apply the image to the Windows partition =============================
    dism /Apply-Image /ImageFile:R:\install.wim /Index:1 /ApplyDir:W:\
    
    rem === Copy the Windows RE Tools to the Windows RE Tools partition ==========
    md T:\Recovery\WindowsRE
    copy W:\windows\system32\recovery\winre.wim T:\Recovery\WindowsRE\winre.wim
    
    rem === Copy boot files from the Windows partition to the System partition ===
    bcdboot W:\Windows /s S:
    
    rem === In the System partition, set the location of the WinRE tools =========
    W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows

5. Setup your device for installation

  1. Make sure your Snapdragon X Elite computer is powered off.

  2. Plug in all the USB drives, mouse and ethernet adapter to it.

  3. Power on the machine and wait until the command prompt window on a plain blue background appears. This means that the WinPE environment has correctly started.

  4. Identify the drive letter for the disk containing the install.wim, CreatePartitions.txt and ApplyImage.bat files. You can use the list volume command from diskpart to help here.

  5. Run the following commands one at a time (replace D: with the drive letter found previously):

    diskpart /s D:\CreatePartitions.txt
    D:\ApplyImage.bat D:\install.wim
  6. If all went successfully, you can power off the machine via shutdown /s

  7. Once powered off, unplug all the USB drives (you can keep the mouse and ethernet adapter plugged in).

  8. Start your machine, which should boot into the Windows installation flow by itself 🎉

@AdionC
Copy link

AdionC commented Jul 9, 2024

Ah alright, strange that 24H2 didn't work directly etiher then, since after installing it on the new SSD the way this guide describes, that new SSD also boots properly. (So the 24H2 image does contain a bootloader that works properly on the xps)

@dmgartung
Copy link

Thank you @caccialdo your solution completely worked for my case with Galaxy Book Edge 4! Great work. Not Samsung nor Microsoft support were able to help me otherwise! Great job mate!

@peterdk
Copy link

peterdk commented Jul 18, 2024

So, having the same issue as @LarveyOfficial , I have a Dell XPS 13 Snapdragon, that came in today. Wanting to install a fresh copy of windows without any Dell software etc. So I found this guide, after having tried to boot a 24H2 Win11 ARM ISO from UUP, which did not do anything.
I can make the WinPE, use Rufus to 'burn' it to a external SSD, and then I have the same experience as @LarveyOfficial, where the boot starts, I see the spinner, for a second, and then it resets. It basically crashes I think.

Tried with the bcedit but that seems only for being able to boot in to the WinPE. I tried the (still existing) recovery and boot from there, but same issue.

Since the goal is also to install a fresh 2TB SSD, I will try the existing install approach, where I run these scripts from the real recovery, instead of WinPE and see if I can boot it. But yeah, that's something I only recommend if you have a backup of the original disk.

Still not useful though for people that have no recovery at all. But at least, we're getting somewhere.

@peterdk
Copy link

peterdk commented Jul 18, 2024

Woei! Got some excellent progress. Probably also useful with the method here. I now tried installing directly using my already installed Windows. Used the scripts, and then moved the external SSD to the internal slot. Replacing the original one.
Then reboot: and.... same crash... :( After 1s.

So last resort, I just tried disabling stuff in the bios. And it worked!! So I guess the XPS has a component that causes the WinPE/Win setup to crash. I am now at the install window of Win11. I guess WinPE will also boot from USB this way.

Anyway, I disabled almost everything. I'll try to see if I can pinpoint which device/setting exactly. But there is hope for Dell users!

@peterdk
Copy link

peterdk commented Jul 18, 2024

OK, I pinpointed it: it's the fingerprint reader. If you disable that, it will boot normally on the Dell XPS!

I have succesfully installed Win 11 now. I'll try to do it again without a installed Windows the coming days.
Also after all updates ran etc, I could re-enable fingerprint reader without issues.

@peterdk
Copy link

peterdk commented Jul 18, 2024

Well, that escalated quickly.. I used UUP to download the latest canary Win 11 build for ARM (Windows 11 Insider Preview 26252.5000 (ge_prerelease) arm64), and with fingerprint disabled, I could just immediately boot it using F12. I 'burned' it using Rufus. So seems this whole workaround is no longer needed. I'll try again with a completely empty NVME, so it is not my current installation interfering.

@peterdk
Copy link

peterdk commented Jul 18, 2024

So yeah, I wiped my NVME, put it back in the laptop, disabled the fingerprint reader, and booted instantly into the 26252 Win 11 install ISO on my USB SSD. Nice!

@caccialdo
Copy link
Author

Nice investigative work @peterdk and glad to hear your laptop is working! My machine is a Samsung Galaxy Book4 Edge which provide a very barebone BIOS unfortunately. I'd be very curious to know if the fingerprint reader was also the reason plain Win11 ISO files wouldn't boot

@peterdk
Copy link

peterdk commented Jul 18, 2024

Thanks. So last update: I got it also working with the stable release Windows 11, version 24H2 (26100.1150) arm64. With disabled fingerprint and a completely wiped local NVME disk, it booted succesfully into the installer and is now installing. Booting setup took a bit longer, but it worked without issue after that. So, seems Microsoft has (almost) full support in the newest images. ( I did select include updates in the UUP dump website, maybe that also did something)

Only thing that I needed was to have a USB ethernet adapter, although with Rufus you can just enable local account and then you can just click through. Oh yeah, the mouse is not working, but the keyboard is, so I could just tab through everything.

Really happy with it! Thanks for the guide and the starting points. Next stop: Linux...!

@peterdk
Copy link

peterdk commented Jul 20, 2024

Bonus: If you use UUP already to download and generate the ISO, you can easily add the Snapdragon Chipset drivers, WIFI/BT drivers and in case of the Dell, the fingerprint sensor driver, to the ISO. Then the setup process does not need anything external, like a mouse or so or disabling stuff in the bios. Very useful also, because these drivers are also set to your recovery, so if you have issues with your system, you don't have to disable the fingerprint sensor again, before being able to fix Bitlocker or so.

So how to do this?

  • visit https://uupdump.net/
  • Click 'Windows 11' dropdown
  • Select 24H2 (currently the latest and greatest)
  • Then pick most recent one, note that you need arm64 version, not amd64
    • In my case that's Windows 11, version 24H2 (26100.1150) arm64
  • Select language and then Next
  • Select the edition you need
  • Select 'Download and convert to ISO`
  • Enable Include Updates
  • Click Create download package
    • This will download a zip file. Extract it somewhere with enough space (10GB+ or so)

Now the nice driver stuff.

  • Create a directory Drivers in the extracted dir
    • Create 3 subdirectories in Drivers: ALL, WinPE and OS
  • Go to your device's support page, in my case Dell XPS 13.
  • Download Chipset, WIFI, GPU and in XPS 13 case, the Goodix Touch Sensor drivers. (And for example a touchpad driver if that is needed)
    • It's better to be conservative here, and only select above basic drivers. I for example got errors when starting setup when I just added all available drivers for my device.
  • Run each downloaded exe, and choose extract. Extract all of them to a new dir.
    • If you have no Dell, just make sure you extract your drivers somehow so you have the dll and inf visible in a (sub) directory, besides other files that belong to it.
  • Move all extracted drivers and their subdirectories to the Drivers\ALL directory you created.
  • Then open ConvertConfig file with a text editor and add under [convert-UUP]:
AddDrivers   =1
Drv_Source   =Drivers
  • Now you can run the uup_download_windows program, and it will build the ISO with the drivers included.
    • Make sure to check the output that it does run a step installing all drivers. It should show multiple lines with installing INF files.

Use Rufus to 'burn' resulting ISO to a USB drive, and you can then boot into it. You can now use the touchpad, WIFI works during setup and no need to disable fingerprint sensor for Dell XPS13!

@mjgalindo
Copy link

This worked great! I was a noob and did not about using 24H2. If you have these symptoms:

  • The winre.wim is too big and won't fit in the 600MB partition, leading to an error at the end of running the script
  • Even if you expand the partition so it will fit, it still will not boot, just rebooting to the boot logo.

Thank you so much!

@wilotas
Copy link

wilotas commented Jul 30, 2024

Bonus: If you use UUP already to download and generate the ISO, you can easily add the Snapdragon Chipset drivers, WIFI/BT drivers and in case of the Dell, the fingerprint sensor driver, to the ISO. Then the setup process does not need anything external, like a mouse or so or disabling stuff in the bios. Very useful also, because these drivers are also set to your recovery, so if you have issues with your system, you don't have to disable the fingerprint sensor again, before being able to fix Bitlocker or so.

So how to do this?

  • visit https://uupdump.net/

  • Click 'Windows 11' dropdown

  • Select 24H2 (currently the latest and greatest)

  • Then pick most recent one, note that you need arm64 version, not amd64

    • In my case that's Windows 11, version 24H2 (26100.1150) arm64
  • Select language and then Next

  • Select the edition you need

  • Select 'Download and convert to ISO`

  • Enable Include Updates

  • Click Create download package

    • This will download a zip file. Extract it somewhere with enough space (10GB+ or so)

Now the nice driver stuff.

  • Create a directory Drivers in the extracted dir

    • Create 3 subdirectories in Drivers: ALL, WinPE and OS
  • Go to your device's support page, in my case Dell XPS 13.

  • Download Chipset, WIFI, GPU and in XPS 13 case, the Goodix Touch Sensor drivers. (And for example a touchpad driver if that is needed)

    • It's better to be conservative here, and only select above basic drivers. I for example got errors when starting setup when I just added all available drivers for my device.
  • Run each downloaded exe, and choose extract. Extract all of them to a new dir.

    • If you have no Dell, just make sure you extract your drivers somehow so you have the dll and inf visible in a (sub) directory, besides other files that belong to it.
  • Move all extracted drivers and their subdirectories to the Drivers\ALL directory you created.

  • Then open ConvertConfig file with a text editor and add under [convert-UUP]:

AddDrivers   =1
Drv_Source   =Drivers
  • Now you can run the uup_download_windows program, and it will build the ISO with the drivers included.

    • Make sure to check the output that it does run a step installing all drivers. It should show multiple lines with installing INF files.

Use Rufus to 'burn' resulting ISO to a USB drive, and you can then boot into it. You can now use the touchpad, WIFI works during setup and no need to disable fingerprint sensor for Dell XPS13!

Amazing manual guy!

@peterdk I have same DELL XPS 13 Snapdragon. I am going to try to install the ISO created.

Just to know, is UUP dump a confiable site to download and build ISO images for Windows???

Regards

@peterdk
Copy link

peterdk commented Jul 30, 2024

@wilotas I understand it just collects references to files hosted by Microsoft. So you download the actual data from Microsoft, not from this website. That's also the only reason why I would recommend them, otherwise malware issues are a possibility.

@wilotas
Copy link

wilotas commented Jul 30, 2024

@wilotas I understand it just collects references to files hosted by Microsoft. So you download the actual data from Microsoft, not from this website. That's also the only reason why I would recommend them, otherwise malware issues are a possibility.

I wanna think so.

BTW what about XPS performance after installing this ISO?

@peterdk
Copy link

peterdk commented Jul 30, 2024

I assume it's just the same? Haven't benchmarked it between those 2, since I needed a fresh install on a new NVME I installed. And I prefer a Windows without Dell added stuff. But since the drivers are official, I doubt Dell can do some magic outside that.

@ashwindeivak
Copy link

Amazing tutorial, where would autounattend.xml would go?

@han-minhee
Copy link

I tried the guide with my Galaxy Book 4 Edge 14' (of which the OS suddenly died and refused to boot)
Windows 11 Home 24H2 26100.1742_arm64 (using UUP dump, with updates included)
ADK 10.1.26100.1 (May 2024)

I didn't plug in the Ethernet during the installation (using PE), and used USB tethering with my phone after the boot into the newly installed Windows 11. Drivers and Samsung software(not all of them) were installed during the first boot, and I could get some more default Samsung services from Microsoft Store.

So far so good. Thank you for the guide!

I was in a hurry and I couldn't try burning W11 ISO directly using RUFUS. One thing I regret is not backing up the Samsung recovery partition, which might be able to be used later.

@ashwindeivak
Copy link

I tried the guide with my Galaxy Book 4 Edge 14' (of which the OS suddenly died and refused to boot) Windows 11 Home 24H2 26100.1742_arm64 (using UUP dump, with updates included) ADK 10.1.26100.1 (May 2024)

I didn't plug in the Ethernet during the installation (using PE), and used USB tethering with my phone after the boot into the newly installed Windows 11. Drivers and Samsung software(not all of them) were installed during the first boot, and I could get some more default Samsung services from Microsoft Store.

So far so good. Thank you for the guide!

I was in a hurry and I couldn't try burning W11 ISO directly using RUFUS. One thing I regret is not backing up the Samsung recovery partition, which might be able to be used later.

Hey, I made an Windows Image Splitter so you can make it work in FAT32, turns out the only issue is your boot drive not being formatted in FAT32. It's not perfect yet but it works. Maybe give it a shot if you plan on reinstalling? (Also, you can use Rufus optimization with this, telemetry question bypass etc)

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