If you have ever tried to boot directly to a linux ISO file, then you will know that it is necessary to tell the linux boot kernel/scripts where to find the ISO file so that it can load it as a 'cdrom' (loop) device and access the files inside the ISO. If this is not done, you will typically see a 'squashfs file not found' error message!
Typically we can fix this by specifying a kernel parameter or 'cheat code'.
A typical grub2 command line which loads the Ubuntu boot kernel and specifies the location of the ISO file would be:
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/_ISO/ubuntu64.iso quiet splash
This allows us to boot from a grub2 USB drive (say), mount the ISO as a loop device and load the kernel and initial ramdrive files from inside the ISO file and then pass on the location of the ISO file so that when the linux kernel boots, it can re-load the ISO file as a loop device again (because the first loop device is lost when the linux kernel loads).
So to boot to linux in this way, we need to know what all these parameters need to be.
The problem is that they vary from version to version and distro to distro and we always have to do some 'research' and experimentation to try to find out what parameters we need. There also may be several menu entries (for live cd, install, safe mode, memtest, etc.) and we would need to make grub2 menus for each of them.
Here is a typical Ubuntu loopback.cfg file which is inside the ISO file:
Typically we can fix this by specifying a kernel parameter or 'cheat code'.
A typical grub2 command line which loads the Ubuntu boot kernel and specifies the location of the ISO file would be:
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/_ISO/ubuntu64.iso quiet splash
This allows us to boot from a grub2 USB drive (say), mount the ISO as a loop device and load the kernel and initial ramdrive files from inside the ISO file and then pass on the location of the ISO file so that when the linux kernel boots, it can re-load the ISO file as a loop device again (because the first loop device is lost when the linux kernel loads).
So to boot to linux in this way, we need to know what all these parameters need to be.
The problem is that they vary from version to version and distro to distro and we always have to do some 'research' and experimentation to try to find out what parameters we need. There also may be several menu entries (for live cd, install, safe mode, memtest, etc.) and we would need to make grub2 menus for each of them.
Enter the loopback.cfg file!
However, some distros, such as Ubuntu, contain a useful loopback.cfg file (located at \boot\grub\loopback.cfg).Here is a typical Ubuntu loopback.cfg file which is inside the ISO file: