ipxe with sanboot
-
Hell all,
so im currently running on Ubunbtu 17.10 and the latest fog updates.
also tgt is installed.so i tried to boot iso with sanhook and sanboot on iscsi target but no luck i always get bad argument on sanhook.
now i am able to boot on iso with:
sanboot http://10.0.0.200/fog/service/ipxe/iso/kali-linux-2017.2-amd64.iso
then when i try to lunch an install well the install try to look itself up on a drive, from where the idea of mounting the iso from a iscsi target.
there is a bunch of distro doing that.
is there a way ? kind of doing that for the sake of being able to renew and add iso without too much alteration.
Thanks for the help
EDIT
ok so after so digging,sanhook -d 0x81
is actually not giving any error the issue is the root-path …
my DHCP server is a pfsense server also the root-path in the dhcp is pointing to a iscsi drive.but here is a preview of what i what to do :
sanhook -d 0x81 ${root-path} sanboot --no-describe iscsi:10.0.0.200:iqn.2017-11.net.tghit:kali
the iscsi drive is actually the iso itself !
i just need to be able to get the client to mount it !Also i read that those line could help to solve my issue still not too sure.
set iscsi-server 10.0.0.200 set base-iqn iqn.2017-11.net.tghit set base-iscsi iscsi:${iscsi-server}::::${base-iqn} isset ${hostname} && set initiator-iqn ${base-iqn}:${hostname} || set initiator-iqn ${base-iqn}:${mac}
please oh please help
For now i was able to boot from iscsi using :
sanboot iscsi:10.0.0.200:::1:iqn.2017-11.net.tghit:kali
but still having my cd load issue … will figure this out and might even post the solution in the dev post so that maybe we can have only a drop in iso for boot wizzard ?
-
This post is deleted! -
@slimzy said in ipxe with sanboot:
kind of doing that for the sake of being able to renew and add iso without too much alteration.
Not every ISO file is the same. Some do a lot of weird magic on startup and simply cannot be started directly from the ISO. Not sure about Kali but I am sure google will tell you how to do it.
Why do you use sanboot by the way? Tried memdisk yet? See here for an example.
-
please take a look to my edit
-
yes tried memdisk the thing is that the iso is looking for a sr0 (probably the dvd-drive) wich is why i’m currious about booting from the iso as a scsi drive (target).
-
now i’m just curious if i can make the iscsi drive stay and appear like a cd/dvd drive… hmmmm…
-
@slimzy While I haven’t event tried or thought about wanting to sanboot an iso image, I can tell you most linux distros don’t like to be pxe booted directly from the ISO even using memdisk. Consider that many linux distributions are several GB in size. You will run into issue trying to transfer a distro iso to memdisk if its over 2GB in size. I don’t know if this is a limitation in memdisk or something else.
I have had much better luck deploying the ISO to the fog server and the pxe booting the distro linux kernel this way: https://forums.fogproject.org/topic/10944/using-fog-to-pxe-boot-into-your-favorite-installer-images
I do have to say, now that i think about it, your approach is interesting using iscsi if for nothing else to answer the question “could it be done”.
-
well memdisk as a limit it can transfer, which is why i’m not using it.
at the step i am right know using :
sanboot iscsi:10.0.0.200:::1:iqn.2017-11.net.tghit:kali
it actually boot but trying to install fail due to that os trying to load the “cd”
so my goal is to use iscsi to mimic a cd/dvd but it need to stay connected while the iso is booting which is the challenge for me since i try to do an all os compatible pxe install server -
@slimzy I think you are heading down a path to failure with iscsi delivery.
Let me say that you may be able to get the kernel to boot using this, but then the kernel will go look for a cdrom and it won’t find one, the iscsi disk may be presented to the linux kernel as a hard drive, or (which is probably the case) once the linux kernel boots it won’t see the iscsi disk at all because that iscsi disk is being managed by iPXE and once iPXE releases the hardware to the linux kernel all of that iscsi stuff is gone. The same as with my tutorial stuff. Once ipxe and tftp delivered the kernel to that target computer, the linux kernel had to have its own way to locate the nfs share to get the rest of the bits.
I might see later tonight if I can add pxe booting into kali linux to my tutorial. It should work.
-
they do have a tutorial but is a netboot (light-boot) iso
-
@slimzy Just for my curiosity, why do you want to boot kali linux from the FOG server. Is your end goal to netboot into a live environment with kali?
-
@george1421 said in ipxe with sanboot:
why do you want to boot kali linux from the FOG server. Is your end goal to netboot into a live environment with
the end goal is to get rid of CD/DVD and usb key.
and also to make as simple as possible (almost drop in) so that i can refresh the distro iso without to much time to make the magic happen.the only other way i can actually see would be to install each distro i what to do and then to configure it to read and connect automatically on the iscsi drive. ( would be doable in a vm to not lose to much time and with script). but to be determined. tell me if that would be something interesting ( could possibly forward the recompiled iso to add into the plugin section for a easy way to get those for other.
also the more the merrier they say !
-
also doing that in fog could very well make fog the best pxe server
-
@slimzy I’m not familiar with kali linux I did use backtrack 5 a few years ago.
I’m pretty sure I can get fog to launch the linux installer or live environment what ever comes up when you boot from the dvd rom. From there I assume you can deploy from the live environment to the target computer’s local hard drive. I’m pretty sure I can do this without iscsi at all. From there you may need to use some scripts to copy your local data back to the target computer.
What I will focus on tonight is just pxe booting kali into what ever comes up when you try to boot from dvd.
I’m currently downloading kali-linux-2017.2-amd64.iso and will start “testing” later tonight. Right now its family time.
-
last time did a pxe server in a suse os i was booting from a copy of the iso. be editing every file of the isolinux file the the new path.
-
is there a way to bind a root-path per item in the menu or we can’t?
-
@slimzy said in ipxe with sanboot:
is there a way to bind a root-path per item in the menu or we can’t?
I’m not sure I understand this ^^
But, I think I have an understanding of what is going on. I can see at the end of the kernel init it attempts to contact the local cdrom. If it doesn’t find it the kernel then starts the network install bits. When you pxe boot I can get the kali linux loader to work (without the dvd iso image). It loads and the reaches out to the internet to download what it needs and completes the installation. I suspect that when you boot off the cdrom that it loads the files directly from the dvd and does not reach out to the internet.