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

71,152

Solution 1

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.

Solution 2

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 :( .

Solution 3

unfortunatly none of these recommendation did not help me. So I have found the way and would love to share with you. To boot centos for example you need: Put iso image in the directory. if your root dir mounted on /dev/sda1, then create dir /iso and put iso there. go to grub console (when menu grub appear press 'c'.)

Choose appropriate device - hd0 means sda. You need to choose one where you iso is located.

loopback loop (hd0,msdos1)/iso/Redhat.iso 
linux (loop)/isolinux/vmlinuz inst.repo=hd:sda1:/iso/Redhat.iso 
initrd (loop)/isolinux/initrd.img 
boot

And boot it!

Solution 4

Seems as though 13.04 requires a different syntax to achieve this. Has anyone successfully booted the ubuntu-13.04-desktop-amd64.iso from a physical disk and would care to share the grub syntax?

EDIT: Answered my own question. Need to rename vmlinuz to mvlinuz.efi and it works.

menuentry "Ubuntu-13.04-desktop-amd64.iso" --class ubuntu {
set isofile="/archives/ubuntu-13.04-desktop-amd64.iso"
loopback loop (hd1,6)$isofile
linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noeject noprompt --
initrd (loop)/casper/initrd.lz
}

Solution 5

I find using the loopback of grub2 invaluable for testing out new isos without requiring a usb stick or burning to CD. There are bugs filed against Fedora to make something similar work. Tracking down the current status is a little bit time consuming.

Share:
71,152

Related videos on Youtube

Rahul Virpara
Author by

Rahul Virpara

Updated on September 18, 2022

Comments

  • Rahul Virpara
    Rahul Virpara over 1 year

    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.

    • Admin
      Admin almost 12 years
      This is not off topic,still unix and linux stack exchange is better unix.stackexchange.com
    • Admin
      Admin almost 12 years
      @Rinzwind how??
    • Admin
      Admin almost 12 years
      The question is about fedora, centOS and opensuse. Not about Ubuntu. @abcd
    • Admin
      Admin almost 12 years
      The question is edited, the first form was about booting an Ubuntu Live ISO of 10.04. But it is now i think off-topic.
    • Admin
      Admin almost 12 years
      It's possible to do from hard drive, we explored options on this question, askubuntu.com/questions/121212/… , As for Fedora, you should probally ask there, forums.fedoraforum.org/showthread.php?t=253518
    • Admin
      Admin almost 12 years
    • Admin
      Admin almost 12 years
      Virpara, Try accepting an answer if you are happy with one. I think, this will help the future visitor
    • Admin
      Admin over 8 years
      @fossfreedom disagree with duplicate because this is specific about being non-Ubuntu images.
  • Rahul Virpara
    Rahul Virpara almost 12 years
    the question is How to create entry in existing GRUB2 not how to make bootable pendrive or external hard disk having different distros. BTW it requires better knowledge of GRUB2 than other distros so it is actually question related to GRUB(because some distro still use GRUB) or GRUB2.
  • fabricator4
    fabricator4 almost 12 years
    I'd say that making a grub entries for distros such as Fedora, Centos and Suse are much more related to those distros than they are to grub, and certainly nothing whatsovever to do with Ubuntu.
  • fabricator4
    fabricator4 almost 12 years
    @virpara : You also did not specify that you are booting ISOs off the hard drive - the most reasonable reason for wanting to boot various LiveISOs is to have a do-everything install device. We are not mind readers, or experts on other distros. Lastly, if you actually install and use MultiSystem to make a pendrive in this way, it will show you how to do it - it uses grub2 to to achieve the results you want.
  • Rahul Virpara
    Rahul Virpara almost 12 years
    I tried above entry for fedora 15 but it didn't work. Any guess?
  • Rahul Virpara
    Rahul Virpara almost 12 years
    my entry looks like this pastebin.com/1ksBVu21
  • gregn3
    gregn3 over 7 years
    Note, when loading ISO files with memdisk and grub initrd16, the ISO file must be smaller than 462 MB. Related error messages: grub: error: couldn't find suitable memory target, memdisk: MEMDISK: No ramdisk image specified. For more details see here and here.