Boot from USB-Stick to get FOG menu for machines without PXE
-
Hi,
i’m looking for a solution to boot machines without PXE-function and get the FOG-menu. (Register Host, Imaging Restoring and so on)
At first i tried it with gpxe (iso which emulate a pxe boot process), but this doesn’t work.
Then i read that it’s better to realize this with ipxe. So i followed this article: https://forums.fogproject.org/topic/4782/help-usb-boot-fog/27 but it don’t works full.I get an IP via dhcp, this is ok. But what i have to do to get the FOG-menu ?
I cloned the ipxe repository from git and so on.
Editing the ipxescript
#!ipxe
dhcp
–> And now what i have to put there ? bzImage, init.xz or boot.php ???
–> My knowledge fails hereAfter this i would create the the iso for my bootable stick with make bin/ipxe.iso EMBED=ipxescript.
Have anyone some ideas ?
Is there someone with the same requirement ?About an answer or help i would be very happy.
Thanks.
Richi
-
@x9rok Take a look at this ipxe script: http://sourceforge.net/p/freeghost/code/HEAD/tree/trunk/src/ipxe/src/ipxescript
This is what is usually included (embedded) in the ipxe binaries loaded via PXE. The important part you are looking for is
chain tftp://x.x.x.x/default.ipxe
-
Funny I was just discussing this the other day with a colleague. I haven’t had a chance to put together a POC yet on this. But the general idea is to create the ipxe boot image on the usb device and then chain to the fog server using the command like Sebastian posted. On your USB boot stick you want to enter something like this: (Understand this just came out of my head, and may be filled with bugs).
set fogserver:ipv4 <ip_addr_fog_server> set next-server ${fogserver} chain tftp://${fogserver}/undionly.kxpe
That “should” tell the ipxe client using the boot media to chain to the fog server. Then the fog server will take over from there.
-
This one may actually work a bit better since it should connect you right to the FOG menu
set fogserver:ipv4 <ip_addr_fog_server> set next-server ${fogserver} chain http://${fogserver}/fog/service/ipxe/boot.php?mac=${net0/mac}
-
I did one a couple of years ago, you could give it a try to see if it still works.
The zip contains an iso which you can burn to usb, and also instructions on how to build it.
https://forums.fogproject.org/topic/4253/physical-boot-disk-for-imaging
0_1448223513202_ipxe_ask33.zip -
@jbsclm interesting, I’ll have to give it a spin on Monday. The discussion with my colleague was about finding a way to uefi boot systems that have a broken net boot under uefi. This may be adapted to help with that issue too.
-
First of all thanks for all answers.
@Sebastian Roth
i tried your solution and it fails. But i’m sure that is running. Because i tried the ISO from jbsclm --> “0_1448223513202_ipxe_ask33.zip” this works. It is nearly the same with some modifications (echos, reads, gotos and so on, and at the end of the code, there is also the command chain tftp://…). So this problem is solved.
The ISO from “jbsclm” is very good (Thanks! FYI it still works) but for my requirements it’s not enough.
Because of this i want to create my own ipxe script.
Now i think the way how i’m building / creating the ipxe.iso is wrong.Here some basic information:
- CentOS 6.7
- cloned git repository ipxe
Here are my steps, how i’m building the ipxe.iso
- editing the ipxescript for example:
!#ipxe dhcp && goto bootup || echo FAIL :bootup echo Enter the IP-Address of the FOG-Server read fog-server chain http://${fog-server}/fog/service/ipxe/boot.php$mac=${net0/mac}
Everything as root…
2. make bin/ipxe.iso EMBED=ipxescript-
copy created ipxe.iso from /ipxe/src/bin/ipxe.iso to some temp folder
-
create bootable stick or CD/DVD
-
try the ISO
My result: When i’m booting from the stick i see:
ISOLINUX …
iPXE ISO boot image
Loading ipxe.krn…ready.
_And then the machine reboot automatically and this never stops.
Do i’m making something wrong ?
Thanks.
Richi
-
@all
Here some new information.
I tried another way to build my ipxe.iso. I tested rom-o-matic and included my ipxescript. It works but tomorrow i have to do further tests. But i’m still interested for some tips how to build it on centos.
I used your script for some tests. For example:
- Removable USB-Stick is set to the first boot-device in Bios --> OK
- Hard Disk is set to second boot-device in Bios --> OK
- Boot from USB-Stick to get an IP and FOG menu --> OK
- If a task was generated on the FOG-Server, the task will run. -->
- If no Task was generated on the FOG-Server, the client should boot from local hard disk. After 20 seconds the clients tries to start again from the usb-flashdisk.
ISOLINUX …
iPXE ISO boot image
Loading ipxe.krn…ready.And then nothing.
@jbsclm Did you have the same problem ?
Thank.
-
One comment here. You don’t need to change the boot order to the USB. Most systems will let you temporarly change the boot order by pressing F12 or F10 during the bios post test. From there you can select your boot media. This is a one time change. On the next reboot (unless you press the boot menu key again) it will return to the normal boot sequence.
. -
@x9rok
It is some while since I last used it, but from what I remember, if there was no task for the PC you should get the FOG menu, which would then time out after the period set in the FOG GUI, if you didn’t select an option.
If you don’t get the FOG menu then it may be that the ipxe script needs changing to pass extra parameters to boot.php.
If the reboot is caused by the timeout expiring, then it could be that the network card is left in a funny state by the previous boot attempt.As per the comment from george1421, you don’t need to change the boot order, F10 or F12 should get you a boot menu, depending on the BIOS. We used Dell PCs, and it was F12 for them.
You really don’t want usb at the top of the boot order, as if you forget to change it back, it is security hole.
It is worth making your BIOS password protected and only having Hard Disk on the boot device list, that way only authorised people can boot from anything other than the Hard Disk. -
@jbsclm said:
@x9rok
It is some while since I last used it, but from what I remember, if there was no task for the PC you should get the FOG menu, which would then time out after the period set in the FOG GUI, if you didn’t select an option.
If you don’t get the FOG menu then it may be that the ipxe script needs changing to pass extra parameters to boot.php.OP: From my post below the boot.php script is looking for the mac parameter to be passed to it. Without that I might understand why you are getting a different reaction.
http://${nextserver}/fog/service/ipxe/boot.php?mac=${net0/mac}