Installing Windows 10 without USB using Ubuntu GRUB
Backup the Target drive.
Create a 6GB NTFS partition on the hard drive and extract the Windows ISO to it.
Create a 20GB, or larger, NTFS partition on the hard drive for the Windows Installation.
Open Disks, (Gnome-Disks), and note Device, (/dev/sdx), and UUID of the Windows ISO extract partition.
For msdos partition table, copy the following menuentry to /etc/grub.d/40-custom/
*:
menuentry 'Windows Recovery Environment (on /dev/sda4)' --class windows --class os $menuentry_id_option 'osprober-chain-592C85254E2CD0B7' {
insmod part_msdos
insmod ntfs
set root='hd0,msdos4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4 592C85254E2CD0B7
else
search --no-floppy --fs-uuid --set=root 592C85254E2CD0B7
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
ntldr /bootmgr
}
Edit menuentry, changing sda4 to sdax
, msdos4
to msdosx
(4 places), and 592C85254E2CD0B7 to UUID, (3 places), to suit step 4 above.
Run sudo update grub
confirm that ntldr /bootmgr
appears in grub.cfg.
Boot the computer into the newly created Windows menuentry and install Windows into it's new partition.
Reinstall Ubuntu if desired, the GRUB bootloader will have been replaced with the Windows bootloader.
*For gpt partition table, copy the following menuentry to /etc/grub.d/40-custom/
:
menuentry 'Windows Recovery Environment (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-5642BC722509341F' {
insmod part_gpt
insmod ntfs
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 5642BC722509341F
else
search --no-floppy --fs-uuid --set=root 5642BC722509341F
fi
drivemap -s (hd0) ${root}
chainloader +1
ntldr /bootmgr
}
Boot selecting Windows from the GRUB menu and follow the instructions.