Create UEFI bootable USB stick to install Windows AND Ubuntu from it
I know how to make a UEFI bootable stick to install Ubuntu (explained here) and I know how to make one to install Windows 7 (guide in German, sorry). I guess for Win 8 the procedure would be similar, but I haven't looked into it.
I also know how to make a legacy bootable stick from which I can install Windows and Ubuntu using YUMI. I have failed so far though at creating a UEFI bootable stick that can do this. When I do a UEFI boot from my YUMI multiboot stick it gives me no option to choose between Ubuntu and Windows (hardly surprising I guess) and instead simply UEFI boots Windows (which I find kind of surprising to be honest but maybe this is due to the fact that I added the Windows image after the Ubuntu image and this simply replaced Ubuntu's EFI boot files).
So how would I proceed to create such a bootable stick?
For EFI booting move all MS content under /EFI to another folder, call it /EFI.ms for example, with BOOT and Microsoft subfolders; this is to disallow certain UEFI firmwares to force boot Windows when they see it. Now under the EFI folder copy the BOOT and Ubuntu folders created for your bootable stick. Under /EFI/Ubuntu append this menu entry to the file grub.cfg you'll find there:
menuentry "Windows 8.1 EFI Setup" {
insmod ntfs
chainloader /EFI.ms/Microsoft/Boot/bootmgfw.efi
boot
}
Make sure you know which folder is which in case your Ubuntu files got replaced after you added the Windows image, I mean the /EFI/BOOT folder; it may contain two files for Ubuntu, bootx64.efi and grubx64.efi; those come from /EFI/Ubuntu folder, I think bootx64.efi is copied from shimx64.efi.
For MBR style booting from the same USB stick, append this entry to the txt.cfg file under /isolinux:
label w81
menu label ^Setup Windows 8.1
COM32 chain.c32
APPEND fs ntldr=/bootmgr
Old Obsolete Question
This question is about Windows 8
This is 2020 and Windows 8 has been replaced by Windows 10. The Windows 10 ISO is greater than 4GB and does not work on a FAT32 USB stick.
It is now much easier to make a bootable USB that will install both the latest Ubuntu and Windows, (and just about every other OS available).
Ventoy
Ventoy installs to a USB disk in less than a minute.
After installation, most OS ISO's can be copy/pasted, dragged/dropped to the USB.
No further setup is required, (unless adding persistence, of which greater than 4GB is allowed).
MS Windows installer disks can be be added.
Linux OS can be added.
FreeBSD, etc, etc can be added.
90%+ distros in distrowatch.com are supported. 550+ ISO files are tested.
There are versions for Windows and Linux.
It is simpler to use than Etcher.
It is open source.
https://www.ventoy.net/en/index.html
https://github.com/ventoy/Ventoy