2

Am trying to get ubuntu-16.04-server-amd64.iso ISO file to boot from grub 2.02~beta2-9ubuntu1.7 found in Ubuntu 14.04 server.

menuentry "Ubuntu 16.04 Server AMD64" --class ubuntu {
  set isopath="/boot/iso"
  set isoname="ubuntu-16.04-server-amd64.iso"
  set isofile="${isopath}/ubuntu/${isoname}"
  echo "Using ${isoname}..."
  loopback loop $isofile
  linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile}
  initrd (loop)/casper/initrd.lz
}

When writing ls in grub mode I can see that my file exist at (hd0,msdos1)/boot/iso/ubuntu-16.04-server-amd64.iso. How can I construct a grub menu entry so I can boot into that ISO file?

Please keep in mind that this is not the Live Ubuntu Desktop ISO file but the server version.

Niklas Hagman
  • 131
  • 1
  • 2
  • 5
  • I do not see you setting partition? loopback loop (hd0,1)$isofile But I have not tried Server version of 16.04 but never got older versions to boot with loopback as there were not configured for that. Back then others got it to work by extracting boot files into ISO folder and using that to boot. – oldfred May 25 '16 at 16:59
  • This is marked as a duplicate, however the other question doesn't mention Ubuntu 16.04 LTS ISO images at all. Every distro you try to boot from an ISO image using grub's loopback needs its own way on the kernel command line to tell it how to find the ISO image. – Marius Gedminas Oct 11 '18 at 14:40

1 Answers1

0

Change line

linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=${isofile}

to

linux (loop)/casper/vmlinuz.efi boot=casper iso-scan/filename=${isofile}

and voila! Should work.

mariaczi
  • 419
  • The current Ubuntu 16.04.5 ISO images do not have /casper/ any more; the kernel is in /install/vmlinuz (no .efi) and the initrd is in /install/initrd.gz. Unfortunately the installer ignores iso-scan/filename and simply fails in the "detect CD-ROM" stage, after letting you select the language & keyboard layout. (The workaround from https://askubuntu.com/a/144914/136 could work, but is annoying.) – Marius Gedminas Oct 11 '18 at 14:43