Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For the benefit of those who may not know, this has been possible (by way of Grub2) with many Linux distros for a while now without custom software. Typically you just add extra boot arguments that point to the iso and flag that booting from it is desired.

Unfortunately the required arguments tend to be poorly documented and quite specific to each distro. This looks like a neat tool that's sidestepping that issue. If anyone knows of a good resource that documents these boot arguments for a range of distros, please share!



Assuming you loopback mount the ISO, I think these are the major args... fill in the "..." wherever you see them:

  # Ubuntu
  linux .../vmlinuz boot=casper file=.../ubuntu.seed iso-scan/filename=...
  initrd ...

  # Arch
  linux .../vmlinuz img_dev=... img_loop=... earlymodules=loop
  initrd ..._ucode.img .../archiso.img

  # Kali
  linux ... boot=live components findiso=... # noautomount
  initrd ...

  # GParted
  linux ... boot=live union=overlay config components toram=....squashfs findiso=...
  initrd ...
In general you'll have to boot the kernels directly as shown above. Using the built-in GRUB menus won't work in many cases. Which makes it difficult to make these future-proof.

You'll also want to make sure you've insmod'ed any modules you need for your hardware as necessary (storage, USB, etc.)... unfortunately documentation on these is poor, and some modules are mutually exclusive, so have fun.

Best of luck getting a robust boot menu script going. Expect to spend weeks if not months on it if you're new to GRUB scripts/components.


And you can find an aggregated list of grub files for various distro's at aguslr's multibootusb:

https://github.com/aguslr/multibootusb/tree/master/mbusb.d


You can also add toram to copy the entire squashfs root to memory. This way you get better performance, and don't need to keep your USB disk plugged in.


Are you referring to grub2iso[1]? If so, I was never able to make it work: either the ISO is too large (IIRC, in the old days it needed to load the full ISO to memory), or, if it did boot, the kernel wouldn't find the ISO ("virtual drive") itself.

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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: