Skip to content

Instantly share code, notes, and snippets.

@bannsec
Last active May 15, 2023 04:52
Show Gist options
  • Save bannsec/f2b88994b5fb664ce59239ab8b4358d8 to your computer and use it in GitHub Desktop.
Save bannsec/f2b88994b5fb664ce59239ab8b4358d8 to your computer and use it in GitHub Desktop.
Manual Creation of Windows installation USB from Ubuntu

This was VERY irritating to figure out. So here are the steps to create an installation usb for Windows manually.

Option 1 -- FAT32 + NTFS

  1. Download the installation iso from Windows (https://www.microsoft.com/en-us/software-download/windows10ISO)
  2. Prepare the usb drive
    • sudo gparted (or cfdisk, whatever)
    • Create partition table of GPT
    • Create 2 partitions
      • fat32 partition of 1024MB with label BOOT (mark it bootable)
      • ntfs partition of the rest of the size, label it INSTALL
  3. Mount the installation iso locally (can right click and "mount" or whatever)
  4. Copy all the files in the root of the iso except for the sources folder into the BOOT mount
  5. Create a directory in the BOOT mount called sources and copy specifically the boot.wim file from the iso/sources directory (yes, there will only be one file in this directory)
  6. Copy all of the iso into the INSTALL mount.
  7. Unmount, eject and enjoy life.

Option 2 - Only FAT32

If you're getting errors when it attempts to install, you can try option 2. This time we'll only have a single FAT32 partition. This would normally be a problem since install.wim is too big to fit on a FAT32 partition. However, we can use Windows to split it up.

  1. Format your thumb drive to use GPT and a single FAT32 partition (say, 16G or so)
  2. Download the iso, same as above
  3. Mount the iso on Windows and copy over everything except for the sources/install.wim (you won't be able to, FAT32 will complain)
  4. In an elevated terminal, convert the install.wim into split wim format:
Dism /Split-Image /ImageFile:F:\sources\install.wim /SWMFile:E:\sources\install.swm /FileSize:3800

In this case the F:\sources\install.wim is the Windows mounted file and the E: drive is the thumbdrive I'm writing directly to. That's it. Unmount and use it to install.

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