Skip to contentSkip to conversation

Live-ISO's over PXE+HTTP using loopback

DISCUSSION Beeblebrox 3 participants 6 messages Feb 15, 2015 – Feb 16, 2015

lore
Share & tools
lore

Beeblebrox

author
#0 lore raw

Hi.
I'm trying to boot several live ISO's using my PXE-boot server and Grub loopback. ISO's are fetched by Grub from an HTTP server on the same host.
* I can boot the kernels of all live ISO's through PXE+HTTP transfer.
* Boot process fails at mount-root stage, where rootfs will obviously be mounted from the ISO. Error message is usually similar "could not find the ISO" or "unable to find medium containing a live file system".
* A sample menu entry I'm using (thanks to previous answers from this list):
menuentry "Debian-testing-i386-lxde.iso"" --class gnu-linux --class gnu --class os {
set root="http,192.168.2.100"
set isofile="debian-testing-i386-lxde.iso"
loopback loop0 ($root)/iso/$isofile
linux (loop0)/install.386/vmlinuz
initrd (loop0)/install.386/initrd.gz

As the first step of solving this problem: Is ISO modification the only choice, or is it possible to boot a normal ISO by passing the correct parameters to grub.cfg? I think the problem could be that ramdisk fails to be created when PXE is involved.

Regards

Signature · 1 line
FreeBSD_amd64_11-Current_RadeonKMS
#1 lore raw

В Sun, 15 Feb 2015 21:37:13 +0200
Beeblebrox <[email protected]> пишет:

Quoted 12 lines

Hi.
I'm trying to boot several live ISO's using my PXE-boot server and Grub loopback. ISO's are fetched by Grub from an HTTP server on the same host.
* I can boot the kernels of all live ISO's through PXE+HTTP transfer.
* Boot process fails at mount-root stage, where rootfs will obviously be mounted from the ISO. Error message is usually similar "could not find the ISO" or "unable to find medium containing a live file system".
* A sample menu entry I'm using (thanks to previous answers from this list):
menuentry "Debian-testing-i386-lxde.iso"" --class gnu-linux --class gnu --class os {
set root="http,192.168.2.100"
set isofile="debian-testing-i386-lxde.iso"
loopback loop0 ($root)/iso/$isofile
linux (loop0)/install.386/vmlinuz
initrd (loop0)/install.386/initrd.gz

Quoted 2 lines

As the first step of solving this problem: Is ISO modification the only choice, or is it possible to boot a normal ISO by passing the correct parameters to grub.cfg? I think the problem could be that ramdisk fails to be created when PXE is involved.

You need to tell your kernel/initrd where to find ISO and it should be able to fetch data from it via HTTP.

author
#2 lore raw

Hi Andrei, thanks for the answer.

Quoted 2 lines

You need to tell your kernel/initrd where to find ISO and it should be able to fetch data from it via HTTP.

I was advised on debian-live, "if ISO contains httpfs, you can boot by pointing the live initramfs to the iso location on your web server"; essentially the same thing you stated.

That's done by params in the "linux" line then? Something like this?
loopback loop0 ($root)$path$isofile
linux (loop0)/casper/vmlinuz.efi boot=casper fromiso=$isofile httpfs=$loop0 initrd (loop0)/casper/initrd.lz }

This is not working though, so:
* Should "fromiso=" be full path "($root)$path$isofile"?
* For "httpfs=", can loop0 be used or should I revert to "($root)$path$isofile"?
* Any other suggestions in above syntax appreciated.

Thanks and Regards.

Signature · 1 line
FreeBSD_amd64_11-Current_RadeonKMS
#3 lore raw
Quoted 10 lines · Beeblebrox

Hi Andrei, thanks for the answer.

Quoted 2 lines

You need to tell your kernel/initrd where to find ISO and it should be able to fetch data from it via HTTP.

I was advised on debian-live, "if ISO contains httpfs, you can boot by pointing the live initramfs to the iso location on your web server"; essentially the same thing you stated.

That's done by params in the "linux" line then? Something like this?
loopback loop0 ($root)$path$isofile
linux (loop0)/casper/vmlinuz.efi boot=casper fromiso=$isofile httpfs=$loop0

grub2 device names are not known by linux, so at least the last kernel parameter is obviously bogus.

Quoted 5 lines

initrd (loop0)/casper/initrd.lz }

This is not working though, so:
* Should "fromiso=" be full path "($root)$path$isofile"?
* For "httpfs=", can loop0 be used or should I revert to "($root)$path$isofile"?

See above. It should use whatever kernel/initrd understands and neither $loop nor $root are understood by kernel. The fact is that linux kernel cannot read from grub2 (loop) device so unless necessary support is in initrd this simply cannot be done.

Quoted 6 lines

* Any other suggestions in above syntax appreciated.

Thanks and Regards.

--
FreeBSD_amd64_11-Current_RadeonKMS

author
#4 lore raw

I got the Gparted ISO to boot, although in a bit roun-about way:

menuentry 'Gparted i386' {
set root="http,192.168.2.100"
set isofile="gparted-live-0.19.0-beta1-3-i486.iso"
loopback loop0 ($root)$isofile
linux (loop0)/live/vmlinuz boot=live config noswap noprompt verbose noeject fetch=http://192.168.2.100/gparted-live-0.19.0-beta1-3-i486.iso initrd (loop0)/live/initrd.img }

I did not use these, since the ISO boots witout them: toram=filesystem.squashfs fromiso=gparted-live-0.19.0-beta1-3-i486.iso

Just to confirm I've got this in my head correctly: It's not possible to partially load a live-CD.iso with the PXE method, unless using NFS or other block device. In absence of NFS/cifs or such, the entire iso must be loaded into RAM. Am I correct with this statement?

Yet, A similar ISO (Debian based) with below config fails due to no netboot or nfsmount, and does not try to fetch the ISO from the http server like it does in the above case. This ISO also has its own grub menu. Would it be possible to fetch the ISO then chainload to the grub inside the ISO? I'm probably overlooking something when asking this question...

menuentry "Inquisitor 3.1B-amd64" {
set root="http,192.168.2.100"
set isofile="inq-live-3.1beta2-amd64-debian.iso"
loopback loop0 ($root)$path$isofile
linux (loop0)/live/vmlinuz-2.6.26-2-amd64 boot=live config noswap noprompt verbose noeject noautologin union=aufs fetch=http://192.168.2.100/pub/tftp/rescue/inq-live-3.1beta2-amd64-debian.iso toram=filesystem.squashfs initrd (loop0)/live/initrd.img-2.6.26-2-amd64 }

#5 lore raw
Quoted 9 lines · Beeblebrox

I got the Gparted ISO to boot, although in a bit roun-about way:

menuentry 'Gparted i386' {
set root="http,192.168.2.100"
set isofile="gparted-live-0.19.0-beta1-3-i486.iso"
loopback loop0 ($root)$isofile
linux (loop0)/live/vmlinuz boot=live config noswap noprompt verbose noeject fetch=http://192.168.2.100/gparted-live-0.19.0-beta1-3-i486.iso initrd (loop0)/live/initrd.img }

Quoted 6 lines

I did not use these, since the ISO boots witout them: toram=filesystem.squashfs fromiso=gparted-live-0.19.0-beta1-3-i486.iso

Just to confirm I've got this in my head correctly: It's not possible to partially load a live-CD.iso with the PXE method, unless using NFS or other block device. In absence of NFS/cifs or such, the entire iso must be loaded into RAM. Am I correct with this statement?

Yet, A similar ISO (Debian based) with below config fails due to no netboot or nfsmount, and does not try to fetch the ISO from the http server like it does in the above case. This ISO also has its own grub menu. Would it be possible to fetch the ISO then chainload to the grub inside the ISO? I'm probably overlooking something when asking this question...

You're overlooking a lot but it was all already explained by Andrey: how Linux finds root is outside of GRUB or any bootloader scope. GRUB only passes parameters through to it. "Chainloading" whatever you mean by it will not help you. Only specialized initrd will. And it's all out of the scope of GRUB or of this list.

Quoted 12 lines

menuentry "Inquisitor 3.1B-amd64" {
set root="http,192.168.2.100"
set isofile="inq-live-3.1beta2-amd64-debian.iso"
loopback loop0 ($root)$path$isofile
linux (loop0)/live/vmlinuz-2.6.26-2-amd64 boot=live config noswap noprompt verbose noeject noautologin union=aufs fetch=http://192.168.2.100/pub/tftp/rescue/inq-live-3.1beta2-amd64-debian.iso toram=filesystem.squashfs initrd (loop0)/live/initrd.img-2.6.26-2-amd64 }

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel