Howto boot ISO images via grub2 with ubuntu
Moin
I am using Ubuntu “Daily builds” for some time inside Suns VirtualBox. Unfortunately the daily builds are not longer booting inside VirtualBox for more then 2 weeks now. Christian told me about a new feature of Grub2. You can boot ISO images directly from your hard disk without burning them on CD or USB. Awesome feature and I had to try it today. Here is the description on how to do it with Ubuntu 9.10.
First I am using this tiny script to update all daily builds with the zsync tool. It transfers only the changed parts of the ISO so you and the Ubuntu teams save a lot of traffic.
zsync http://cdimages.ubuntu.com/daily-live/current/lucid-desktop-i386.iso.zsync cd kubuntu zsync http://cdimages.ubuntu.com/kubuntu/daily-live/current/lucid-desktop-i386.iso.zsync cd ../netbook zsync http://cdimages.ubuntu.com/ubuntu-netbook/daily-live/current/lucid-netbook-i386.iso.zsync cd ../xubunutu zsync http://cdimages.ubuntu.com/xubuntu/daily-live/current/lucid-desktop-i386.iso.zsync cd .. rm `find ./ -name "*.zs-old" `
This script keeps all my daily builds up to date.
Next Step is to enable the grub menu. In Ubuntu it can be done in “/etc/default/grub“. Change the following lines
GRUB_HIDDEN_TIMEOUT=10 GRUB_HIDDEN_TIMEOUT_QUIET=false
With this change you will see a 10 seconds count down when booting up. With the shift-key you get access to the grub boot menu. Next is to add the ISO images to the grub menu. Change to the “/etc/grub.d” dir.
Here you can find the grub menu entries and configuration files. Add your ISO images starting with 50 here. For example my entry for the normal Ubuntu ISO image (50_ubuntu) looks like this:
echo "Adding $(egrep menu[e]ntry $0 | cut -d'"' -f2)" >&2
cat << EOF
menuentry "Ubuntu 10.04 Daily Build" {
loopback loop (hd0,3)/ansi/software_and_config/ISOs/ubuntu/lucid-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ansi/software_and_config/ISOs/ubuntu/lucid-desktop-i386.iso file=(loop)/preseed/ubuntu.seed quiet splash bootkbd=sg --
initrd (loop)/casper/initrd.lz
}
My ISO files are stored on sda3 under /ansi/software_and_config/ISOs/ubuntu/. In order to change it for your needs there are 3 elements to change. The loopback line contains your hard disk in grub style (hdx,y x=0->sda x=1->sdb aso) and the path. The third element to change is in the linux line. Store this file as “50_ubuntu” in “/etc/grub.d“, make it executable with “chmod a+x 50_ubuntu” and activate the changes with “ubdate-grub“. After a reboot you should be able to activate the grub menu with the shift-key and select the new entry. Have fun.
I found some pages on this topic but the description there was not working for me so I changed it. But take a look on your own:










February 7th, 2010 at 08:51
Find & Replace “chance” to “change”
February 7th, 2010 at 19:44
[...] the daily builds are not longer booting inside VirtualBox for more then 2 weeks now More here You can boot ISO images directly from your hard disk without burning them on CD or USB. Awesome [...]
February 8th, 2010 at 04:04
[...] Howto boot ISO images via grub2 with ubuntu [...]
February 13th, 2010 at 11:40
[...] GNU/Linux: Howto boot ISO images via grub2 with ubuntu [...]
March 17th, 2010 at 14:54
Hey, just came here after a good google search. Fine blog you have here! Keep it up!
May 5th, 2010 at 22:09
Thanks for this.I’m confused on these new Ubuntu’s coming with squashfs images and initrd(casper dir) is now “initrd.lz”(lzma) unlike earlier “initrd.gz”(gzip).
Will try your way.thanks again!
July 9th, 2010 at 19:44
Mobile music is the trend nowadays, it makes sense to have great music on your mobile phone.;-,
July 17th, 2010 at 12:23
[...] dont know why they put stuff there…? check this out too; keep your ubuntu builds up to date http://ansi.interblc.com/2010/02/06/…2-with-ubuntu/ my point being that you may be able to use ubuntu's new kernel I know a way to create livecd from [...]
July 23rd, 2010 at 02:16
[...] and you can keep that iso up-to-date without having to download new iso's using "zsync" http://ansi.interblc.com/2010/02/06/…2-with-ubuntu/ very [...]