Building a Windows install medium on Linux

The problem

Imagine you were living in a Linux-only world, and suddenly felt the urgent need to install Windows on a laptop, for reasons entirely your own and not up for debate. (I'll get into that in a different post, promise.) Now, seeing as you have probably installed your fair share of Linux systems, and/or created rescue systems (either urgently required or due to painful experience and resulting paranoia), you download the image file, and use a tool of your choice, maybe dd, to put the .iso onto a USB drive, as you are used to doing. You put the drive into the PC and … it doesn't accept it as a boot device.

The solution

Now, since you're not me, you won't first debug partition table fuckups, and figure out how exactly UEFI relates to GPT vs MRB partition tables. Instead, you'll quickly figure out that apparently Windows .isos are not made for easy booting and require some more magic. There are two ways to provide this magic on Linux:

The easy way

Since you already have a Windows image on your Linux Desktop – just use that image to create a Virtual Machine, and then use the proper Windows tooling to put it onto the USB drive. It's overly complex, but it just works, and had I thought of this, it would have saved me quite some trouble.

The Linux way

But maybe you don't have virtualization software set up already, or you don't want to use it, or you want to get this to work on Linux on principle, this is what you do: You get yourself a copy of WoeUSB, and either use their GUI (woeusbgui) or their command line tool (woeusb).

Caveat: sudo woeusb --device Windows10.iso /dev/sdb did not work for me. Instead I had to wipe the USB drive, make a new partition and a GPT partition table (use any old tool like gparted), and then run sudo woeusb --partition Windows10.iso /dev/sdb1.

Caveat 2: Microsoft does not provide checksums for their downloads, and apparently the installers don't or don't completely check their integrity. If the installation process starts, then aborts for weird reasons, try another download.