It was painful but I got Ubuntu ISO working with
loopback loop (hd0,gpt1)/PATH/TO/UBUNTU.iso
set root=(loop)
configfile /boot/grub/loopback.cfg
which in turn seems to load the kernel via linux /casper/vmlinuz file=/cdrom/preseed/ubuntu.seed iso-scan/filename=/PATH/TO/UBUNTU.iso
initrd /casper/initrd
if you just make sure your path doesn't have spaces. (I forget if you also need to pass boot=casper or not.)You'll have to detect the disk though. It's possible to automate it somewhat, but not trivial (at least if you don't know how). You'll want to use search. https://www.gnu.org/software/grub/manual/grub/html_node/sear...
And make sure you've insmod'ed any modules you need for your hardware if necessary (storage, USB, etc.)... unfortunately documentation on these is poor, and some modules are mutually exclusive, so have fun.
I only got it to work with simple things that load fully from RAM -- say, debian-installer, which only requires kernel+initrd.
It has to be simple and reliable. If it's only one of them, I would rather carry an extra USB stick which I can always format (I do).
[1]: https://help.ubuntu.com/community/Grub2/ISOBoot