iPXE discussion forum
[Solved] Boot to ipxe on UEFI machine to menu - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: [Solved] Boot to ipxe on UEFI machine to menu (/showthread.php?tid=8314)



[Solved] Boot to ipxe on UEFI machine to menu - sebus - 2017-02-03 13:43

I have a simple setup of

server1= SCCM 2012 R2
server2= MS DHCP server

MS DHCP option 66/67 are configured for ipxe clients (legacy) to boot to undionly.kkpxe created with embedded script that does:

#!ipxe
dhcp net0
set 209:string pxelinux.cfg/default
set 210:string http://sccm.domain.com/tftpboot/
chain ${210:string}pxelinux.0

That works perfect for legacy PXE boot

Tried to follow DHCP policies as per:

https://wiki.fogproject.org/wiki/index.php?title=BIOS_and_UEFI_Co-Existence#Using_Windows_Server_2012_.28R1_and_later.29_DHCP_Policy

to get it boot to ipxe.efi (build from source with same script) from EFI network boot on physical hardware

But none of my attempts was ever successful
each time such machine boots directly only to SMSBoot\x64\wdsmgfw.efi from SCCM server

I do NOT think using DHCP only options is even possible with MS DHCP (no matter what somebody else says, but please prove me being wrong)

http://www.wardvissers.nl/2016/02/12/dont-use-dhcp-option-606667-when-you-want-to-use-uefi-legacy-pxe-boot-with-mdt/

Anybody any ideas how/what to change to make it boot to the menu? (but still have WDS, as it must be used for SCCM to do imagining)

sebus


RE: Boot to ipxe on UEFI machine - NiKiZe - 2017-02-03 23:42

Hi a few things i wish to comment on..
Why are you using undionly.kkpxe ? it might cause you some grief and you might want to use undionly.kpxe instead.

You will want to have a bootx64.efi (ipxe.efi) that you load when arch is efi, For the windows DHCP it is some poorly documented magic somewhere that you need to change.

Maybe something from 2pint sw could help you identify how to do this: quick google gave me: https://2pintsoftware.com/whitepaper-using-dhcp-uefi-bios-pxe-booting/


RE: Boot to ipxe on UEFI machine - sebus - 2017-02-04 14:17

Been using undionly.kkpxe for years, as it was the only one that worked in my tests with pxelinux.0 menu
Never had major problems with any cards that I was using.

Thanks for the link, this document is not any different than the link I provided already, and somehow I can not get it behaving that way...

2pintsoft pdf states:

7 EFI BC boot\x64\wdsmgfw.efi smsboot\x64\wdsmgfw.efi

Definbitely NOT what I see in my setup

my UEFI machines only boot from

\Boot\x64\wdmgfw.efi from SCCM server

without any special config (as I can not even figure out where to config that setting!)


RE: Boot to ipxe on UEFI machine to menu - sebus - 2017-02-07 13:56

No, can not make it boot via DHCP options.
Have them configured exactly as per pdf, but now ONLY boot happens from smsboot\x64\wdsmgfw.efi (tested on Gen2 Hyper-V VM) - that is due to ProxyDHCP WDS replying (if I disable it, then DHCP options are not used at all!)

[Image: efi_boot.png]

I have Policy for UEFI based network booting with Vendor Class PXEClient (UEFI x64) as PXEClient:Arch:00007 configured and specified option 67 in that Policy

[Image: option67.png]

Yet, UEFI client takes no notice at all of these settings

sebus


RE: Boot to ipxe on UEFI machine to menu - sebus - 2017-02-09 10:16

Anybody having any ideas why that does not work?

BIOS legacy network boot with Policy PXEClient:Arch:00000 works OK, but UEFI network boot via Policy PXEClient:Arch:00007 gets ignored & only SMSBoot\x64\wdsmgfw.efi gets pulled from TFTP server

sebus


RE: Boot to ipxe on UEFI machine to menu - sebus - 2017-02-09 17:14

I can "cheat" and rename ipxe.efi to wdsmgfw.efi (which is only good till WDSServer service restarts - as it copied back the original file!)

("hardcoded" SMSBoot\x64\wdsmgfw.efi comes form ProxyDHCP of WDS reply)

That way it will boot to ipxe from UEFI network stack fine, but get error 0xc000000f

I have been doing wimboot via legacy PXE for years (with ipxe--> pxelinux.0 menu)



Now I need to move to UEFI, so the whole lot gets re-designed



So created new EFI BCD

Code:
#Create a BCD store using bcdedit.exe:

bcdedit /createstore e:\BCD

#Configure RAMDISK settings:

bcdedit /store e:\BCD /create {ramdiskoptions} /d "Ramdisk options"
bcdedit /store e:\BCD /set {ramdiskoptions} ramdisksdidevice boot
bcdedit /store e:\BCD /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
bcdedit /store e:\BCD /create /d "WinPE boot image" /application osloader

#The last command will return a GUID, for example:

#The entry {cd4acce3-ef87-11e6-ada6-f8b156ae2ab6} was successfully created.

#Copy this GUID for use in the next set of commands. In each command shown, replace "GUID1" with your GUID.

#Create a new boot application entry for the Windows PE image:

bcdedit /store e:\BCD /set {GUID1} device ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}
bcdedit /store e:\BCD /set {GUID1} path \windows\system32\winload.efi
bcdedit /store e:\BCD /set {GUID1} osdevice ramdisk=[boot]\sources\boot.wim,{ramdiskoptions}
bcdedit /store e:\BCD /set {GUID1} systemroot \windows
bcdedit /store e:\BCD /set {GUID1} detecthal Yes
bcdedit /store e:\BCD /set {GUID1} winpe Yes

#Configure BOOTMGR settings (remember to replace GUID1 in the third command with your GUID):

bcdedit /store e:\BCD /create {bootmgr} /d "Windows Boot Manager"
bcdedit /store e:\BCD /set {bootmgr} timeout 20
bcdedit /store e:\BCD -displayorder {GUID1} -addlast

UEFI PXE IPv4 boots fine to iPXE menu, all wimboot-2.5.2-signed files get downloaded:

Code:
#!ipxe
kernel http://10.0.0.55/wim/BOOT/wimboot252 gui
initrd http://10.0.0.55/wim/boot/fonts/segmono_boot.ttf segmono_boot.ttf
initrd http://10.0.0.55/wim/boot/fonts/segoe_slboot.ttf segoe_slboot.ttf
initrd http://10.0.0.55/wim/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
initrd http://10.0.0.55/wim/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
initrd http://10.0.0.55/wim/BOOT/bootmgr.efi bootmgr.efi
initrd -n BCD http://10.0.0.55/wim/EFI/Microsoft/Boot/BCD BCD
initrd http://10.0.0.55/wim/BOOT/BOOT.SDI BOOT.SDI
initrd http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM
boot

at which point it dies with error EFI\Microsoft\Boot\BCD 0xc000000f



Obviously the BCD is there (downloaded), so have no idea why it fails

[Image: wimboot_efi.png]

BCD is being read, as I can chose the correct Windows Boot Manager by Enter at error screen (which then fails again)

[Image: RDO.png]

sebus


RE: Boot to ipxe on UEFI machine to menu - sebus - 2017-02-12 21:11

SOLVED (with help from Misty on reboot.pro)

In uefi mode, wimboot does not appear to tolerate files with different than expected being mapped. It is expecting boot.wim and the original file being mapped as boot.wim must also be named boot.wim.

E.g.

Code:
initrd http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM

.
Will not work. However...

Code:
initrd http://10.0.0.55/wim/wim/Win10PESE_x64/BOOT.WIM BOOT.WIM

.
....does work fine.


RE: Boot to ipxe on UEFI machine to menu - NiKiZe - 2017-02-12 22:03

(2017-02-12 21:11)sebus Wrote:  SOLVED (with help from Misty on reboot.pro)

In uefi mode, wimboot does not appear to tolerate files with different than expected being mapped. It is expecting boot.wim and the original file being mapped as boot.wim must also be named boot.wim.

E.g.

Code:
initrd http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM

.
Will not work. However...

Code:
initrd http://10.0.0.55/wim/wim/Win10PESE_x64/BOOT.WIM BOOT.WIM

.
....does work fine.

What you need here is
Code:
initrd -n boot.wim http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM
-n boot.wim is used for efi environment while boot.wim at the end is used as name for legacy boot.

If you don't want to create a BCD by yourself you can use the one at https://github.com/NiKiZe/wimboot-bcd/blob/bcdgen/PXEBCD in that repo is also script to generate it from scratch and examples of how to use bcdedit.

and for your scripts

Code:
#!ipxe
kernel http://10.0.0.55/wim/BOOT/wimboot252 gui
initrd http://10.0.0.55/wim/boot/fonts/segmono_boot.ttf segmono_boot.ttf
initrd http://10.0.0.55/wim/boot/fonts/segoe_slboot.ttf segoe_slboot.ttf
initrd http://10.0.0.55/wim/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
initrd http://10.0.0.55/wim/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
#initrd http://10.0.0.55/wim/BOOT/bootmgr.efi bootmgr.efi
initrd -n BCD http://10.0.0.55/wim/EFI/Microsoft/Boot/BCD BCD
initrd http://10.0.0.55/wim/BOOT/BOOT.SDI BOOT.SDI
initrd -n boot.wim http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM
boot

bootmgr is extracted from provided wim, and -n is "missing" on lots of lines. but in reality you only need:
Code:
#!ipxe
kernel http://10.0.0.55/wim/BOOT/wimboot252 gui
initrd -n BCD http://10.0.0.55/wim/EFI/Microsoft/Boot/BCD BCD
initrd -n boot.sdi http://10.0.0.55/wim/BOOT/BOOT.SDI BOOT.SDI
initrd -n boot.wim http://10.0.0.55/wim/wim/Win10PESE_x64.WIM BOOT.WIM
boot

example script with all files available over ipfs: http://ipfs.io/ipfs/QmWhRKfSy9s3fRaNVTJN1jt2CH9VHJWG7fTfeDbPdUREow


RE: [Solved] Boot to ipxe on UEFI machine to menu - misty - 2017-02-14 09:17

@NiKiZe
Using the initrd -n switch is working - I can't find any reference to this switch anywhere though.

Please can someone explain a bit more about this switch. And also any other undocumented wimboot switches that might be useful.

Regards,

Misty


RE: [Solved] Boot to ipxe on UEFI machine to menu - NiKiZe - 2017-02-14 12:45

(2017-02-14 09:17)misty Wrote:  Using the initrd -n switch is working - I can't find any reference to this switch anywhere though.

Please can someone explain a bit more about this switch. And also any other undocumented wimboot switches that might be useful.

-n is short for --name option to initrd which is used in efi to set "local" name of the file in EFIFS, documentation is available at http://ipxe.org/cmd/imgfetch

in regards to which options the wimboot binary takes you can take a look at http://ipxe.org/wimboot and http://ipxe.org/appnote/wimboot_architecture


RE: [Solved] Boot to ipxe on UEFI machine to menu - misty - 2017-02-14 18:46

(2017-02-14 12:45)NiKiZe Wrote:  ...in regards to which options the wimboot binary takes you can take a look at http://ipxe.org/wimboot and http://ipxe.org/appnote/wimboot_architecture...
Thanks. Having re-read the wimboot_architecture page in conjunction with your post(s) I understand it a bit more.

Cheers.

Misty


RE: [Solved] Boot to ipxe on UEFI machine to menu - IBIT.ZEE - 2020-05-13 19:42

.

Thanks Misty... your '-n' was a time-saver... Cool

and tanks Nikize for the well formulated questions... Tongue

.