Ceci est une ancienne révision du document !
How To Boot An ISO File From GRUB
Way back in issue #121 (May 2017), Alan Ward wrote an article on “Installing Ubuntu Without External Media”. It involved using GRUB to boot from an ISO file stored on your hard disk, rather than burning it to a USB stick or to an optical disk. I used Alan's method a few times, but things have moved on since then. The following (top right) is my slightly updated method.
Download the iso file and save it in your / (root) folder. My home folder is encrypted, so for the purposes of this test, I cannot save it under there. It needs to be in an un-encrypted folder.
Next, as root, edit /etc/grub.d/40_custom and append the following to the end of the file. Kubuntu 19.10 is used as an example.
NOTES: • To test another distro, just change the menuentry name (line 1) and the iso filename (line 5). • Lines 2, 3 & 4 are not strictly necessary. They are there for completeness. • Lines 4 & 6 assume GPT partitioning. If using old-style MBR partitioning, change “gpt” to “msdos”. gpt7 refers to the root partition of the existing (host) distro, in my case /dev/sda7. • Lines 7 & 8. Check the filenames in the test distro. They might be something like vmlinuz.efi and initrd.lz. In Kubuntu 19.10, these files do not have extensions. • Line 9. Don't forget the closing curly brace.
Save file, then in Terminal, run:
sudo update-grub
Reboot. You should see an entry in the GRUB menu for the test distro, enabling you to try it out in a live environment. You can even install it from there, same as usual.
This is also a good way to store and use a “rescue” distro.
Paul Romano