My /etc/grub.d/40_custom is:
menuentry 'Knoppix 64-bit ISO' {
set gfxpayload=text # ~= vga='normal'
set isofile_abspath='/boot/KNOPPIX_V8.0.0DVD-2017-02-02-DE2EN.iso'
set isofile_devpath="${devroot}${isofile_abspath}"
loopback loop "(${root})${isofile_abspath}"
linux '(loop)/boot/isolinux/linux64' knoppix64 lang=it apm=power-off nomce libata.force=noncq hpsa.hpsa_allow_any=1 loglevel=1
initrd '(loop)/boot/isolinux/minirt.gz'
}
menuentry 'GParted 64-bit ISO' {
set gfxpayload=text # ~= vga='normal'
set isofile_abspath='/boot/gparted-live-0.29.0-1-amd64.iso'
set isofile_devpath="${devroot}${isofile_abspath}"
loopback loop "(${root})${isofile_abspath}"
linux '(loop)/boot/vmlinuz' boot='live' union='overlay' username=user config components noswap noeject toram='filesystem.squashfs' ip='' nosplash findiso="${isofile_abspath}" nomodeset locales=it_IT.UTF-8 keyboard-layouts=it gl_batch
initrd '(loop)/live/initrd.img'
}
dd if=pathtoiso.iso of=/dev/sdX bs=4M && sync
to write iso's to usb's, where sdX is the usb you want to write the iso
]]>insmod part_msdos
insmod ext2
insmod ntfs
set isofile=/OS/archlinux-2018.02.01-x86_64.iso
set root=(hd2,gpt1)
loopback loop $isofile
linux (loop)/arch/boot/x86_64/vmlinuz img_loop=$isofile
initrd (loop)/arch/boot/x86_64/archiso.img
insmod ntfs
set root=(hd2,gpt1)
loopback loop /OS/archlinux-2018.02.01-x86_64.iso
linux (loop)/arch/boot/x86_64/vmlinuz boot=casper iso-scan/filename=/OS/archlinux-2018.02.01-x86_64.iso noprompt noeject
initrd (loop)/arch/boot/x86_64/archiso.img
The errors i get are the following:
error: read out of range
error: you need to load the kernel first