3

I follow Grub2 ISO boot guide

https://help.ubuntu.com/community/Grub2/ISOBoot

here is my menu for iso booting

menuentry "Ubuntu 14.04 Live" {
     set isofile="/lilw/os/ubuntu.iso"
     loopback loop (hd0,10)$isofile
     linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
     initrd (loop)/casper/initrd.lz
}

but I failed to boot from iso file, it always make my system reboot.No message giving out so I don't know what happen.

If I get into grub menu and then using command at

grub >

typing these follow command:

grub > loopback loop (hd0,10)/lilw/os/ubuntu.iso
grub > linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=$isofile noprompt noeject
grub > initrd (loop)/casper/initrd.lz

and then

grub > boot

it will boot to the iso normally.

I don't want to boot this way. But the menuentry in grub does not work.

FYI: I have multiple version of ubuntu running on my system, range from 10.04 to the latest. My iso file store in sda10 which is a /home for the current ubuntu grub.

Edit 1: I extract the contains of iso file but still can't boot with ubuntu. But I can boot with Fedora 20 when extract it contains to a folder, weird..

Edit 2: Finally I find a site that help out with new grub2 command syntax. all the failed boot is because of wrong syntax in grub2

TRY THIS: solved my problems

http://git.marmotte.net/git/glim/tree/grub2

So my grub menu entry will look like this:

menuentry "Ubuntu 14.04 (LTS) Live Desktop amd64" --class ubuntu {
   set isoname="ubuntu-14.04-desktop-amd64.iso"
   set isofile="/lilw/os/${isoname}"
   loopback loop (hd0,10)$isofile
   linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile} quiet splash
   initrd (loop)/casper/initrd.lz
}

if I missing the two '{ }' of isofile it won't boot. so weird

3
  • Are you sure path should not be /home/lilw....? At point grub is loading, nothing is mounted, so everything is at default locations on drive. I converted to just using a /iso folder on another hard drive. And I also changed grub to use a configfile so I do not have to run sudo-update grub every time I edit my ISO boot. I can just edit configfile in my iso folder. I also have nVidia and have to add nomodeset to my boot entry.
    – oldfred
    Jul 20, 2014 at 16:06
  • I know it is not /home/lilw.. because I booting from Linux Mint using the same path /lilw/os/mint.iso and it works. And I don't get what you mean by use a configfile in iso folder?
    – lilw
    Jul 20, 2014 at 16:57
  • configfile is exactly what your link to glim is using. Although I just have one configfile entry in my grub and then in the actual config file have my various boot stanzas.
    – oldfred
    Jul 21, 2014 at 4:46

4 Answers 4

1

Try this

 menuentry "Ubuntu 14.04 Live" {
 loopback loop (hd0,10)/lilw/os/ubuntu.iso
 linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=/lilw/os/ubuntu.iso noprompt noeject
 initrd (loop)/casper/initrd.lz
 }
2
  • actually I tried that already, but it still not works. thanks. btw, I figured it out by follow some instruction here git.marmotte.net/git/glim/tree/grub2
    – lilw
    Jul 20, 2014 at 17:32
  • 1
    Glad to hear that you fixed it. Then post your findings as an answer.
    – kenn
    Jul 20, 2014 at 17:50
1

In many versions of ubuntu iso as in Ubuntu 18.10 (Cosmic Cuttlefish), the files initrd.lz are just initrd . I suggest you to go and inspect your iso file for initrd and vmlinuz files.

While booting Ubuntu 18.10, I had also made that mistake.

0
  • Place your ISO file to /live:

sudo mkdir /live

sudo cp somelinux.iso /live

  • Add new menu entry to the grub.cfg

sudo gedit /etc/grub.d/40_custom

menuentry 'ISO Ubuntu 14.04 2014 Live' --class os --class gnu-linux --class gnu --class os --group group_main {
                set isofile="/live/ubuntu-14.04-desktop-amd64.iso"

         insmod ext2
         insmod loopback
         insmod iso9660      
                loopback loop (hd0,msdos5)$isofile      

                linux (loop)/casper/vmlinuz.efi  file=(loop)/cdrom/preseed/ubuntu.seed noprompt boot=casper persistent iso-scan/filename=/$isofile quiet splash --
                initrd (loop)/casper/initrd.lz


}

TO DO:

  1. change in the menu entry above the code name for your partition, holding /live/somelinux.iso, in my case it's hd0,msdos5 because it is on /dev/sda5/

  2. change the file name from somelinux.iso to yours, in my case I have: ubuntu-14.04-desktop-amd64.iso

    • update GRUB

sudo update-grub

  • reboot
3
  • maybe this works for you, but it will not works for me, if I do the $isofile it won't know the iso, I must do thing like ${isofile}
    – lilw
    Jul 24, 2014 at 10:12
  • @lilw yes, it definitely works for me, and do you want to say it won't work for you in spite that the set isofile="/live/ubuntu-14.04-desktop-amd64.iso" is presented? Jul 24, 2014 at 10:22
  • yes, I did it just like what you said before, and it won't find the iso file, but if I did insert the two '{ }' outside the isofile it able to find it, really weird to me. example like this: iso-scan/filename=/${isofile}. so just the syntax. I don't know why
    – lilw
    Jul 24, 2014 at 11:47
-1

I figured out the problem is the syntax of grub2 changed. follow this link and find your grub entry to boot, there is still some lines you will need to fill in to work.

http://git.marmotte.net/git/glim/tree/grub2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .