How to boot from non-Ubuntu live ISO images like Fedora or CentOS?

I found that it can be done with loopback as follows

menuentry "Lucid ISO" {
loopback loop (hd0,1)/boot/iso/ubuntu-10.04-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-10.04-desktop-i386.iso noprompt noeject
initrd (loop)/casper/initrd.lz
}

But it works only with ubuntu or its derivatives. How it should be written if I want to boot other live images like fedora, cent, opensuse etc. ?

Edit: I found some other entries but all of them are probably debian based.

menuentry "Linux Mint 10 Gnome ISO" {
 loopback loop /linuxmint10.iso
 linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=/casper/initrd.lz iso-scan/filename=/linuxmint10.iso noeject noprompt splash --
 initrd (loop)/casper/initrd.lz
}

menuentry "DBAN ISO" {
 loopback loop /dban.iso
 linux (loop)/DBAN.BZI nuke="dwipe" iso-scan/filename=/dban.iso silent --
}


menuentry "Tinycore ISO" {
 loopback loop /tinycore.iso
 linux (loop)/boot/bzImage --
 initrd (loop)/boot/tinycore.gz
}


menuentry "SystemRescueCd" {
 loopback loop /systemrescuecd.iso
 linux (loop)/isolinux/rescuecd isoloop=/systemrescuecd.iso setkmap=us docache dostartx
 initrd (loop)/isolinux/initram.igz
}

Edit2: How to chainload grub and syslinux from grub2?

Edit3: I want to boot other live images without any removable devices and use grub2 so need menu entries specific to grub2.


Booting from iso is a feature which must be supported by the distro, and the iso-scan/filename= option will not work in Fedora or others. Those might have other kernel options for this feature or the feature may be not supported at all.

I have found a method to boot Fedora 16 DVD, here's below.

Booting Fedora 15 DVD iso from grub

menuentry "Fedora 15 (DVD)" {
 insmod loopback
 insmod iso9660
 set isofile="/Fedora-15-x86_64-DVD.iso"
 loopback loop (hd0,2)$isofile
 linux (loop)/isolinux/vmlinuz rootfstype=auto  root=live:UUID=:$isofile ro quiet
 initrd (loop)/isolinux/initrd.img
}

It assumes your iso file is at the root of second partition of the internal hard disk.

source: this page

You can search for other distribution in google, since it is not a distro-independent feature.

Note 1: It also worked with Fedora 16, I have just tested it.
Note 2: It seems that the method worked when you place the iso file in a fat or ext4 partition.


Booting grml small iso from grub2

Grml can also be booted from grub2. Note that it uses findiso option instead of iso-scan/filename option, indicating that Booting from iso is implemented as different options in different distributions.

(menuentry "Grml small 2009.10" {
  loopback loop /boot/iso/grml-small_2009.10.iso
  linux (loop)/boot/grmlsmall/linux26 findiso=/boot/iso/grml-small_2009.10.iso apm=power-off lang=us vga=791 boot=live nomce noeject noprompt --
  initrd (loop)/boot/grmlsmall/initrd.gz
}

This page has several examples of other distros booting from Grub2.


Booting openSUSE 13.1 Live from iso

Here is the only solution that worked (all others gave me a Failed to find MBR identifier and stopped). In this example the iso is placed at the first disk’s third partition in the directory /home/username/.

menuentry "openSUSE_13.1_GNOME_Live" {
  load_video
  insmod gzio
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos3)'
  set isofrom_device='/dev/sda3'
  set isofrom_system='/home/username/openSUSE-13.1-GNOME-Live-i686.iso'
  set loader='/boot/i386/loader'
  loopback loop $isofrom_system
  linux   (loop)$loader/linux isofrom_device=$isofrom_device isofrom_system=$isofrom_system ramdisk_size=512000 ramdisk_blocksize=4096 ro quiet splash $vt_handoff preloadlog=/dev/null showopts
  initrd  (loop)$loader/initrd
}

Source is janeppo’s comment.


Fedora 17 Gnome Live Iso

Here is the boot menu grub.cfg entry for Fedora 17. the iso is placed at the first disk's third partition. Also the filename is changed.

menuentry "Fedora Live" {
    loopback loop (hd0,3)/fedora.iso
    linux (loop)/EFI/BOOT/vmlinuz0 root=live:/fedora.iso rootfstype=auto ro liveimg quiet rhgb rd.luks=0 rd.md=0
    initrd (hd0,3)/initrd-fromiso
}

Last Note: I think this answer serve as an example. It should not be elaborated more with examples.


Here is which iso files I figured out to boot using grub2.

I have successfully booted following ISOs

  • Ubuntu Precise Pangolin 12.04 ISO
  • SystemRescueCd
  • Boot Hardware Detection Tool
  • Free Dos
  • Hiren's boot CD
  • Ultimate Boot CD

I found that if you want to boot other ISOs like Hiren's Boot CD, etc. you can use MEMDISK utility as kernel.

Where to Get MEMDISK ?

Download Syslinux from here. Move it to Desktop.

How to make it work ?

cd ~/Desktop/
tar xvif syslinux-4.05.tar.xz 
cd syslinux-4.05/memdisk/
sudo mkdir /customboot
sudo mv memdisk /customboot/
cd /customboot/
sudo mv memdisk memdisk4.05
gksudo gedit /etc/grub.d/40_custom 

Then paste below entries in gedit. You'll need to change set isofile="/path/to/iso-file.iso".

Then issue update-grub. Reboot and check.

My entries in 40_custom file.

menuentry "Ubuntu Natty Narwhal 11.04 ISO" {
    set isofile="/OS/ubuntu-11.04-desktop-i386.iso"
    loopback loop (hd0,6)$isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject --
    initrd (loop)/casper/initrd.lz
}
menuentry "Ubuntu Precise Pangolin 12.04 ISO" {
    set isofile="/OS/ubuntu-12.04-desktop-i386.iso"
    loopback loop (hd0,6)$isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject --
    initrd (loop)/casper/initrd.lz
}
menuentry "SystemRescueCd" {
    set isofile="/OS/systemrescuecd-x86-2.7.0.iso"
    loopback loop (hd0,6)$isofile
    linux (loop)/isolinux/rescuecd isoloop=$isofile setkmap=us docache dostartx
    initrd (loop)/isolinux/initram.igz
}
menuentry "Boot Hardware Detection Tool from iso using memdisk 4.05" {
    linux16 /customboot/memdisk4.05 iso
    initrd16 /customboot/hdt.iso
}
menuentry "Free Dos from iso using memdisk 4.05" {
    set isofile="/OS/fdbasecd.iso"
    linux16 /customboot/memdisk4.05 iso
    initrd16 (hd0,6)$isofile
}
menuentry "Hiren's boot CD using memdisk 4.05" {
    set isofile="/OS/Hiren's.BootCD.10.1.iso"
    linux16 /customboot/memdisk4.05 iso
    initrd16 (hd0,6)$isofile
}
menuentry "Ultimate Boot CD iso using memdisk 4.05" {
    set isofile="/OS/ubcd511.iso"
    linux16 /customboot/memdisk4.05 iso
    initrd16 (hd0,6)$isofile
}

All ISOs are kept on sda6/OS and MEMDISK is kept on partition where ubuntu is installed(in root) and renamed to memdisk4.05 so path to it is /customboot/memdisk4.05

note : fedora didn't work with the other answer given. Still trying to boot fedora :( .