To boot the Win10-Image from your HDD
:
- Add the below code to
/etc/grub.d/40_custom
- Back up
/boot/grub/grub.cfg
with sudo cp /boot/grub/grub.cfg.bak
. (Or add a number, if there already is a grub.cfg.bak
.)
- Then run
sudo grub-mkconfig -o /boot/grub/grub.cfg
.
Grub2
-configuration:
menuentry "Windows 10" --class windows --class os {
# Insert modules needed in order to access the iso-file
insmod part_gpt
#insmod part_msdos
insmod ntfs
#insmod ext2
# Insert module needed in order to find partition
insmod search_fs_uuid
# Set UUID of partition with the iso-image
# and let grub2 find the partition
# (save it's identifier to the variable $root)
set uuid="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
search --no-floppy --set=root --fs-uuid $uuid
# Mount the iso image by addressing it with (partition)/path
set iso=/images/Win10_English_x64.iso
loopback loop ($root)$iso
# boot (chain-load) the image using the cdboot.efi file located
# on the win10-image
chainloader (loop)/efi/microsoft/boot/cdboot.efi
}
Instructions:
Replace XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
with the UUID
of the partition, that holds the Windows 10 image.
insmod part_gpt
: This module is needed, if the Win10-ISO-Image lies on a drive with a GPT-partitiontable.
insmod part_msdos
: Choose this one over insmod part_gpt
, if the image lies on a drive with DOS-partitiontable.
insmod ntfs
: This module is needed, if the Win10-ISO-Image lies a NTFS
-partition.
insmod ext2
: Replace insmod ntfs
with insmod ext2
, when the image lies on a ext2/ext3 or ext4 partition.
I have a system that boots in Legacy BIOS mode. I have an iso on an ntfs partition so I chose
insmod ntfs
and choseinsmod part_msdos
(and in a separate attemptinsmod part_gpt1) but I get
error: invalid signature` which my research shows has something to do with UEFI. WHich seems to relate to cdboot.efi. What should I use for legacy bios mode? – 0fnt – 2019-01-26T18:22:20.920@0fnt Take a look at: https://wiki.gentoo.org/wiki/GRUB2/Chainloading#Windows_.28MSDOS_based_boot_loaders.29 Try adding
– Arch Linux Tux – 2019-01-27T15:34:32.123insmod chain
and replace the last line withchainloader (loop)+1
1https://superuser.com/users/352691/arch-linux-tux @arch-linux-tux Thanks- I tried it but I had the same
error: invalid signature
. I even had secure boot disabled. For now I copied ISO contents to a partition and usedntldr /bootmgr
but if you do come across a solution- please do mention. Thanks – 0fnt – 2019-01-28T06:16:01.480this won't work in UEFI, it throws
not avalid root device
– Wang – 2019-10-25T20:59:37.757