I had to create a USB Windows installation disc on my Debian 12 machine and found out it's slightly harder than I wanted it to be. Regular linux ISO's use something called ISOHybrid which allows just a regular dd command to exactly copy over the bytes. Apparently Windows does not do the same thing according to the developer of Rufus which I have used before on Windows to create Windows discs.

On Debian 12 I had to:

  1. Download the official Windows ISO from Microsoft https://www.microsoft.com/software-download/windows11
  2. Use this bash script called WoeUSB. I got it via wget https://github.com/WoeUSB/WoeUSB/releases/download/v5.2.4/woeusb-5.2.4.bash
  3. Make that script executable. chmod +x woeusb-5.2.4.bash
  4. Had to unmount my disc via CLI, not the file explorer sudo umount /dev/sdb1
  5. Run it as sudo sudo ./woeusb-5.2.4.bash Install any packages you have missing. Make sure to run as sudo so it finds the packages properly. I was missing sudo apt install wimtools
  6. Check for your target device via lsblk Do NOT write over your own harddisc.
  7. Command should look something like this. sudo ./woeusb-5.2.4.bash --device ./Win11_23H2_English_x64v2.iso /dev/sdb Make sure to use the proper disc path, it might not be sdb.
  8. My first time running this failed with
                    Info: Installing GRUB bootloader for legacy PC booting support...
                    grub-install: error: /usr/lib/grub/i386-pc/modinfo.sh doesn't exist. Please specify --target or --directory.
                    ERROR: The command ""${command_grubinstall}" --target=i386-pc --boot-directory="${target_fs_mountpoint}" --force "${target_device}"" failed with exit status "1", program is prematurely aborted
                
  9. sudo apt install grub-pc-bin fixed this, running the command again afterwards fixed the GRUB issue.
  10. Had to use NTFS format changing the command to sudo ./woeusb-5.2.4.bash --device ./Win11_23H2_English_x64v2.iso /dev/sdb --tgt-fs NTFS
  11. On my laptop I had to reenable Secure Boot for it to properly detect the USB