boot ISO image directly from HD

steps for UEFI BIOS

1 – Add an entry on end on /etc/grub.d/40_custom file

cat >> /etc/grub.d/40_custom <<'EOF'
menuentry "Peppermint Custom ISO MKUSB+PinguyBuilder" {
  set isofile="/path/to/iso/peppermint_linux_customized_with_pinguy_builder.iso"
  loopback loop (hd0,gpt2)$isofile
  linuxefi (loop)/casper/vmlinuz from=${isofile} boot=casper iso-scan/filename=${isofile} quiet splash hostname=pc
  initrdefi (loop)/casper/initrd.gz
}

menuentry "Bodhi Linux Custom ISO MKUSB+PinguyBuilder" {
  set isofile="/path/to/iso/bodhi-5.1.0-64-hwe_custom_mkusb+pinguyBuilder.iso"
  loopback loop (hd0,gpt2)$isofile
  linuxefi (loop)/casper/vmlinuz from=${isofile} boot=casper iso-scan/filename=${isofile} quiet splash hostname=pc
  initrdefi (loop)/casper/initrd.gz
}

menuentry "Debian 10.4 Live ISO" {
  set isofile="/home/nickollas/Downloads/ISO/debian-live-10.4.0-amd64-xfce.iso"
  loopback loop (hd0,gpt2)$isofile
  linuxefi (loop)/live/vmlinuz-4.19.0-9-amd64 boot=live findiso=${isofile} components
  initrdefi (loop)/live/initrd.img-4.19.0-9-amd64
}

menuentry "Kali Linux 2020.1b ISO" {
  set isofile="/path/to/iso/kali-linux-2020.1b-live-amd64.iso"
  loopback loop (hd0,gpt2)$isofile
  linuxefi (loop)/live/vmlinuz-5.4.0-kali2-amd64 findiso=${isofile} boot=live components splash hostname=pc
  initrdefi (loop)/live/initrd.img-5.4.0-kali2-amd64
} 

menuentry "Manjaro Linux 20" {
  set isofile="/path/to/iso/manjaro-xfce-20.0.1-minimal-200511-linux56.iso"
  loopback loop (hd0,gpt2)$isofile
  linuxefi (loop)/boot/vmlinuz-x86_64 img_dev=/dev/disk/by-uuid/${rootuuid} img_loop=${isofile}
  initrdefi (loop)/boot/intel_ucode.img (loop)/boot/amd_ucode.img (loop)/boot/initramfs-x86_64.img
}
EOF

2 – Update GRUB2 for UEFI BIOS

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

steps for non-UEFI BIOS

1 – Add an entry on end on /etc/grub.d/40_custom file

cat >> /etc/grub.d/40_custom <<'EOF'
menuentry "Debian 9.2 Install ISO" {
  set isofile="/path/to/iso/debian-9.2.1-amd64-netinst.iso"
  loopback loop (hd0,3)$isofile
  linux (loop)/install.amd/vmlinuz from=${isofile} iso-scan/filename=${isofile} quiet splash hostname=pc
  initrd (loop)/install.amd/initrd.gz
}

menuentry "Porteus ISO" {
  set isofile="/path/to/iso/Porteus-XFCE-v3.1-x86_64.iso"
  loopback loop (hd0,3)$isofile
  linux (loop)/boot/syslinux/vmlinuz from=${isofile} quiet splash hostname=pc
  initrd (loop)/boot/syslinux/initrd.xz
}
EOF

2 – Update GRUB2 for non-UEFI BIOS

update-grub2

Get other configs to grub in the GRUB Live ISO Multiboot page: https://glee.thias.es/GLIM

Leave a comment