FOG boot alternatives
-
Hello. I run a small computer repair shop that sees dozens of different machines from various OEMs each day. Many are a few years old or more. I setup FOG earlier this year, and it is absolutely amazing - however, I have not been able to consistently use FOG on machines without a built-in ethernet jack; namely Ultrabook PCs. Some do not support it at all, others seem to require that the iPXE builds I’m creating use specific USB-to-NIC adapters.
For instance, today I was working on a 1st-generation Lenovo X1 Carbon; there is no way to get this thing to PXE boot on a USB NIC! Thus I have to install Windows the old fashioned way (and wait 20 hours for the updates to finish).
Anyways, what I’d like to do (as a workaround) is figure out the proper way to boot systems like this into a compatible environment - for instance, in the CloneZilla days I could just boot Parted Magic and load CZ from there. Is there a similar approach in FOG? Is this the right direction to go?
Thank you for your time.
PS The FOG server is running on Ubuntu 16.04 64bit.
-
First let me say those carbons are a PITA to work with.
In your case you do have a few options. You can create a bootable usb flash drive that contains an iPXE kernel to kick start the machine into the FOG menu. This only requires that the target computer has an ethernet adapter and can boot from USB. The ethernet adapter can be usb or built in as long as its supported by iPXE and FOS (the customized linux OS that uploads and downloads images to the target computer).
For legacy (bios) mode: https://forums.fogproject.org/topic/6347/usb-boot-bios-client-into-fog-menu
For Uefi mode: https://forums.fogproject.org/topic/6350/usb-boot-uefi-client-into-fog-menu-easy-way
https://forums.fogproject.org/topic/6400/usb-boot-uefi-client-into-fog-menu-harder-way
These are also posted on the FOG wiki.The other way is to build a FOS usb boot drive. There isn’t tight integration that you have when you use the iPXE FOG menu, but if you are running 1.3.0RCx branch this method will work too. In this case you build a universal (bios, uefi) boot drive to boot the fos image. You can register directly from the usb drive but you have to schedule a deployment from the fog server before you usb boot the target system for deploy/capture. It does work as long as you have your workflow down. https://forums.fogproject.org/topic/7727/building-usb-booting-fos-image
-
Hi,
i found out that lenovo offers a USB 3.0 Network dongle that support pxe:
https://community.spiceworks.com/topic/492524-boot-from-docking-station-nic
and this is the dongle: http://shop.lenovo.com/us/en/itemdetails/4X90E51405/460/BF8C0B7DC9BB4C13B5EF4FE54E3ABB39
One of the features announced on the product page isBooting from LAN and loading image from remote server both on legacy BIOS and UEFI BIOS system
Best price in germany around 20,50€ including shipment.
On amazon.com around 25$:
https://www.amazon.com/4X90E51405-Thinkpad-Ethernet-Adapter-Compatible/dp/B00GKBL4NA/ref=sr_1_1?ie=UTF8&qid=1481127225&sr=8-1&keywords=4X90E51405When you want to purchase, pay attention to the part number. Needs to be: 4X90E51405
Regards X23
-
I’m going to order one of these adapters, thanks! Am I to understand that OEMs require specific USB chipsets (in this case, Lenovo) in order to PXE boot over USB?
-
@yochaigal In uefi mode yes for typically OEM, in the case of bios mode, as long as the network device supports PXE booting and has a pxe rom installed then any device will work. For uefi mode only supported network adapters can be used (i.e. that lenovo usb adapter may not work in a Dell in uefi mode)
-
@george1421
The BIOS must also support it, yes? -
@yochaigal said in FOG boot alternatives:
@george1421
The BIOS must also support it, yes?For bios mode if the network adapter has a pxe boot rom (and some usb ethernet adapters do) then it will work in (almost) any device in bios mode. But understand that pxe booting in bios mode has been around since 2001 so its well established. The key is to get the network adapter with the PXE roms.
-
Hi,
at work i have to do with Surface 3 / 4 and HP X2.
For both devices (no embedded wired nic) you need external USB Devices.In my case for the Surface s*** i take the original Surface USB 3.0 Ethernet Stick (available since the Surface 3):
For the HP X2’s i take their original USB Type C Dock:
Regards X23
-
Running Version 1.3.0-RC-29
SVN Revision: 6031First, I built a BIOS bootable client:
After ensuring the BIOS is in Legacy mode, I try booting the USB stick. It gets to iPXE initializing devices… and then quickly flashes some text, only to return to the boot devices screen.Second, I built a UEFI bootable client:
Switching to UEFI mode in the BIOS, the USB is completely ignored.I built the FOS client but I get an error after the menu: fatal error unknown request type null
Finally I created a debug USB, I can boot to the debug console but am unsure where to go from there.
-
@yochaigal said in FOG boot alternatives:
Running Version 1.3.0-RC-29
SVN Revision: 6031I built the FOS client but I get an error after the menu: fatal error unknown request type null
This I can help you with, kind of. This is the caveat I warned you about. You MUST schedule a capture or deploy task BEFORE pxe booting the client. Normally the fog iPXE menu would take care of this for us, but since we are not using it/scheduled so the target doesn’t know what to do.
go back and schedule a task first then pxe boot the target computer.
-
Ooooh, I see. The primary use here is to setup deploy tasks (typically updated Windows images). Would I need to add the USB NIC’s MAC each time?
-
@yochaigal no once its registered then all you need to do is change the image associated with the host and then schedule a deploy.
With that said, if someone was pretty smart, you could update the grub configuration to call the FOG quick image function. This would let you deploy an image from the target system and never need to touch the FOG server itself. The issue with the quick image function right now is it requires the iPXE kernel to load the image selections to pick in the menu. If one of the @Developers could provide me with an example of a quick image kernel boot/load call, we could do some interesting things with the FOS usb boot drive. Understand this would be a one off situation for each FOG environment, but I think it would be pretty cool if it worked.
The idea is to create a grub menu to call the correct quick image kernel boot with the proper settings to tell fog to quick image the target system. This way you wouldn’t need to register the computers at all. You would do this because you are using fog to image systems one time and then may never see that computer again (IT repair shop). I have a picture in my head of what needs to be done, what’s missing is the quick image call to boot FOS.
-
@george1421 I briefly read over the params article over at the ipxe website, and did some playing around and was able to hack it together. The
##params
variable is just expanded into get variables on the URL. The below worked for me.http://10.0.0.3/fog/service/ipxe/boot.php?mac=aa:bb:cc:dd:ee:ff&arch=x86&username=wayne&password=MyAmazingPassword&qihost=1
Going to that URL on my FOG server gives me this, which looks good:
#!ipxe set fog-ip 10.0.0.3 set fog-webroot fog set boot-url http://${fog-ip}/${fog-webroot} goto MENU :MENU menu item Acerbase Acer-base item CentOS7VM CentOS7-VM item compaq_cq60_Ubuntu16 compaq_cq60_Ubuntu16 item Optiplex380CentOS7 Optiplex-380-CentOS7 item Windows10 Win10Machine item Win2012R2 Win2012R2 item Win7 Win7 item return Return to menu choose target && goto ${target} :Acerbase set imageID 9 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :CentOS7VM set imageID 8 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :compaq_cq60_Ubuntu16 set imageID 10 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :Optiplex380CentOS7 set imageID 3 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :Windows10 set imageID 4 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :Win2012R2 set imageID 11 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :Win7 set imageID 1 params param mac0 ${net0/mac} param arch ${arch} param imageID ${imageID} param qihost 1 param username ${username} param password ${password} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :return params param mac0 ${net0/mac} param arch ${arch} isset ${net1/mac} && param mac1 ${net1/mac} || goto bootme isset ${net2/mac} && param mac2 ${net2/mac} || goto bootme :bootme chain -ar http://10.0.0.3/fog/service/ipxe/boot.php##params goto MENU
-
We could probably BASH together an interactive menu that asks for username/pass and then just parses items from the below URL call via
wget
and then from that - display another dynamic menu via BASH for image selection. You could go ahead and lead the charge, or you could wait for me and I could script it when I get some time. -
If I understand you correctly, this would be exactly what I’m looking for. Would the end result simply require a custom grub.cfg that calls the image process?
-
@yochaigal This is correct. If you look in the grub.conf you can see the proper FOS boot commands for the defined actions. If we knew what the proper boot commands were for quick image (we must define the exact image we want to boot) then we could create additional menu items to call the quick image from the fos boot.
I tried to figure it out by reverse engineering it. But got stuck on an issue and then moved on.
-
@george1421 Well heck that was easy… I’d like to think I was smarter than I was 6 months ago. I have the answer I think I need.
Let me see if it works as we need it.
-
I’ve had some success but not a WIN yet. I can USB boot FOS but it get stopped attempting to check in to the FOG server. I must be still missing something. But for documentation purposes this is what I have so far for a new grub entry.
menuentry "1c. FOG Quick Image Deploy Win10Ent" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=init.xz root=/dev/ram0 rw ramdisk_size=127000 keymap= web=$myfogip/fog/ storage=$myfogip://images/ storageip=$myfogip boottype=usb consoleblank=0 rootfstype=ext4 imgid=19 type=down osid=9 echo loading the virtual hard drive initrd $myinits echo booting kernel... }
I’m going to have to unpack the FOS virtual hard drive to see where/why the quick image deployment is not checking into the FOG server or what parameter is missing. Please understand we ( I ) am attempting to do something that FOG was never designed to do.
In theory it should work, but also in theory pushed hard enough a pig should fly too.
-
@george1421 If a host is registered, the tasking should actually be present on the fog server.
Now, I could be wrong, but where are
$myimage
,$myfogip
,$myloglevel
and$myinits
defined?The
$myimage
I imagine should be the “kernel” you’re trying to load (typically bzImage).
The$myloglevel
I think could be statically defined (typically it’s set at 4 if you just wanted to get to a “working” state.The “false” tasking I have is: currently defined as:
#!ipxe set fog-ip 10.0.7.1 set fog-webroot set boot-url http://${fog-ip}/${fog-webroot} kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=127000 web=10.0.7.1/ consoleblank=0 rootfstype=ext4 mac= ftp=10.0.7.1 storage=10.0.7.1:/images/ storageip=10.0.7.1 osid=5 irqpoll chkdsk=0 img=win7 imgType=n imgPartitionType=all imgid=1 imgFormat= shutdown=0 capone=1 type=down imgfetch init_32.xz boot
Replacing the ipxe components out with the grub function I might think:
menuentry "1c. FOG Quick Image Deploy Win7" { echo loading the kernel linux bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=127000 web=10.0.7.1/ consoleblank=0 rootfstype=ext4 mac= ftp=10.0.7.1 storage=10.0.7.1:/images/ storageip=10.0.7.1 osid=5 irqpoll chkdsk=0 img=win7 imgType=n imgPartitionType=all imgid=1 imgFormat= shutdown=0 capone=1 type=down boottype=usb initrd init.xz }
None of this will work without knowing the imgPartitionType, imgid, imgType, and img. (Yes this is needed too).
Now the components (Variables I might create?):
$myimage
should equal the binary kernel to boot to, in my case bzImage (the 64 bit kernel).
$myinits
should equal the binary fs to boot to, in my case init.xz (the 64 bit fs).
$myloglevel
should be (you guessed it) the loglevel which is 4.
$myfogip
should be the IP of the fogserver (in my case it’s 10.0.7.1).
$myosid
should be the osid of the of the image being sent. (my case would be 5).
$myimg
should be the name of the image.
$myimgid
(The id of the image to send)
$myimgPartitionType
(The image partition type – typically all)
$myimgFormat
(The format 0, or empty for partclone, 1 for partimage).
$mytype
(The type of image to perform – not strictly necessary)
$myramsize
(The ramdisk_size)
$mymac
(The host’s mac address).This would change the function to look more like:
menuentry "1c. FOG Quick Image Deploy Win7" { echo loading the kernel linux $myimage loglevel=$myloglevel initrd=$myinits root=/dev/ram0 rw ramdisk_size=$myramsize web=${myfogip} consoleblank=0 rootfstype=ext4 mac=${mymac} ftp=${myfogip} storage=${myfogip}:/images/ storageip=$myfogip osid=$myosid irqpoll chkdsk=0 img=$myimg imgType=$myimgType imgPartitionType=$myimgPartitionType imgid=$myimgid imgFormat=$myimgFormat shutdown=0 capone=1 type=$mytype boottype=usb initrd $myinits }
The important bit here is the “capone=1” portion. This is what tricks the system to do the work without requiring a “valid” generated task. (meaning a host doesn’t have to be registered for this to work).
-
@Tom-Elliott Sorry about not being clear on this one. That code fragment was in regards to the code section of this post: https://forums.fogproject.org/topic/7727/building-usb-booting-fos-image/4
The grub.conf contains those variables you questioned. I got the grub boot to start the FOS kernel but it got hung up during booting at checking in to the FOG server. Where it kept looping every 5 seconds trying to check in.
What I was attempting to do is a quick image without needing to register the target computer with FOG. In regards to the OPs post he just needs to deploy a standard set of images to a random collection of computers. He doesn’t need FOG to manage them (I’m envisioning what he needs is some type of fancy clonezilla setup, but using the power of FOG). What I’m trying to do is create a grub menu that simulates the selection of the ipxe quick image menu.
Thank you for the detailed information, its going to take a bit to digest all of that detail.