Booting WinePE on uefi system



  • Hello,

    I am quite new to FOG but loving it so far. I’m not sure if this issue is directly related to FOG or something else.

    I am attempting to add a menu entry to boot WinPE on uefi systems. This is my entry:

    kernel nfs://10.100.0.55:/winimgs/iso/Winpe/EFI/Boot/bootx64.efi
    initrd nfs://10.100.0.55:/winimgs/iso/Winpe/Boot/BCD BCD
    initrd nfs://10.100.0.55:/winimgs/iso/Winpe/Boot/boot.sdi boot.sdi
    initrd nfs://10.100.0.55:/winimgs/iso/Winpe/sources/boot.wim boot.wim
    boot

    This was adapted from things i found in other guides. Mainly this https://forums.fogproject.org/topic/6284/booting-mdt-2013-litetouch-with-fog/6

    It gets pretty far but then i end up with a connection timed out error when it gets to the boot.wim.

    Error ScreenShot

    I have another entry to boot WinPE on legacy systemsd this one works 100%. The extracted files are from the ISO that boots on legacy systems.

    This is the legacy entry for reference:

    login
    kernel memdisk
    initrd nfs://10.100.0.55:/winimgs/iso/win10install/WinPE_amd64.iso
    chain memdisk iso raw
    boot || goto MENU

    Again i’m not sure this relates directly to FOG but was not sure where else to post. I currently only have 1 uefi system in my environment but would like to get it working before uefi becomes more common here.

    Thank you for any help/advice in advance.
    Marc


  • Moderator

    Something you might consider.

    login
    kernel nfs://10.100.0.55/winimgs/iso/Winpe/wimboot gui
    iseq ${platform} pcbios && goto mem_bios || goto no_mem
    :mem_bios
    initrd -n bootmgr.exe    nfs://10.100.0.55/winimgs/iso/Winpe/bootmgr.exe bootmgr.exe
    goto mem_cont
    :no_mem
    initrd -n bootx64.efi   nfs://10.100.0.55/winimgs/iso/Winpe/bootx64.efi                 bootx64.efi    
    :mem_cont
    initrd -n bcd           nfs://10.100.0.55/winimgs/iso/Winpe/BCD                         bcd
    ...
    

    Also realize that ${fog-ip} is a variable that expands out to the IP address of your fog server. If you use the variable it makes your pxe menus portable between FOG servers.



  • @george1421 said in Booting WinePE on uefi system:

    I did not post this in the thread because it didn’t work for the tutorial. Here is what I was working on for the boot image. Its not 100% accurate for what you need, but it does explain a few things.

    1. You need to use wimboot to fix a few evils that MS imposes.
    2. The file name on the end is needed for bios systems
    3. the -n <name> is needed for uefi systems.
    4. You can use the same concepts and even menu for both uefi and bios systems, you just have to be a little sneaky.

    Assume this code snippet is broken because I haven't proved that it works or not.

    kernel tftp://${fog-ip}/wimboot gui
    initrd -n bootx64.efi   tftp://${fog-ip}/boot/bootx64.efi                 bootx64.efi    
    initrd -n bcd           tftp://${fog-ip}/boot/bcd                         bcd
    initrd -n boot.sdi      tftp://${fog-ip}/boot/boot.sdi                    boot.sdi
    initrd -n segmono_boot.ttf tftp://${fog-ip}/boot/fonts/segmono_boot.ttf   segmono_boot.ttf
    initrd -n segoe_slboot.ttf tftp://${fog-ip}/boot/fonts/segoe_slboot.ttf   segoe_slboot.ttf
    initrd -n segoen_slboot.ttf tftp://${fog-ip}/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
    initrd -n wgl4_boot.ttf tftp://${fog-ip}/boot/fonts/wgl4_boot.ttf         wgl4_boot.ttf
    initrd -n boot.wim      tftp://${fog-ip}/boot/boot.wim                    boot.wim
    boot
    

    If you look at this post you can see how you can dynamically detect between bois and uefi systems. https://forums.fogproject.org/topic/11873/single-ipxe-menu-entry-for-both-bios-uefi

    So for uefi systems you load the uefi kernel and for the bios systems you load the bios winpe kernel.

    This worked great. WinePE booted on UEFI system. Thank you again for the great fast reply @george1421 So with your guidance this is my final entry for Winpe:

    login
    iseq ${platform} pcbios && goto mem_bios || goto no_mem
    :mem_bios
    kernel memdisk
    initrd nfs://10.100.0.55:/winimgs/iso/win10install/WinPE_amd64.iso
    chain memdisk iso raw
    boot || goto MENU
    :no_mem
    kernel nfs://10.100.0.55/winimgs/iso/Winpe/wimboot gui
    initrd -n bootx64.efi   nfs://10.100.0.55/winimgs/iso/Winpe/bootx64.efi                 bootx64.efi    
    initrd -n bcd           nfs://10.100.0.55/winimgs/iso/Winpe/BCD                         bcd
    initrd -n boot.sdi      nfs://10.100.0.55/winimgs/iso/Winpe/boot.sdi                    boot.sdi
    initrd -n segmono_boot.ttf nfs://10.100.0.55/winimgs/iso/Winpe/segmono_boot.ttf   segmono_boot.ttf
    initrd -n segoe_slboot.ttf nfs://10.100.0.55/winimgs/iso/Winpe/segoe_slboot.ttf   segoe_slboot.ttf
    initrd -n segoen_slboot.ttf nfs://10.100.0.55/winimgs/iso/Winpe/segoen_slboot.ttf segoen_slboot.ttf
    initrd -n wgl4_boot.ttf nfs://10.100.0.55/winimgs/iso/Winpe/wgl4_boot.ttf         wgl4_boot.ttf
    initrd -n boot.wim      nfs://10.100.0.55/winimgs/iso/Winpe/boot.wim                    boot.wim
    boot || goto MENU
    

    Now it’s still odd…it booted fine the first time on my uefi system but the second time i got the connectiuon timed out again…seems like something odd with the uefi network stack on this dell latitude E5550 laptop or something…



  • Thank you for all the great information @george1421 lets see how far i can get with this.


  • Moderator

    As you can see below you can use both tftp, nfs, or even http to access the files. You just need to have the files in the proper location to be able to find them with different protocols.

    nfs == /images/…
    tftp == /tftpboot/…
    http == /var/www/html/…


  • Moderator

    @mgrondin said in Booting WinePE on uefi system:

    @george1421 It is 405mb

    405MB is OK. You just have to remember that ipxe has a 1GB total memory limit for all dynamically loaded (initrd) files. This includes the kernel plus all initrd files.

    This is what I had in my records for bios booting. Assume that this is also broken since I have not documented it worked. BUT the point of this one is you see that bootmgr.exe is used for bios system.

    kernel nfs://${fog-ip}:/images/os/mswindows/wimboot
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/bootmgr.exe bootmgr.exe
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/bcd bcd
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/fonts/segmono_boot.ttf segmono_boot.ttf
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/fonts/segoe_slboot.ttf segoe_slboot.ttf
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/fonts/wgl4_boot.ttf wgl4_boot.ttf
    initrd nfs://${fog-ip}:/images/os/mswindows/10-1607/boot/boot.sdi boot.sdi
    initrd -n boot.wim nfs://${fog-ip}:/images/os/mswindows/10-1607/sources/BOOT.wim boot.wim
    imgstat
    boot
    

  • Moderator

    I did not post this in the thread because it didn’t work for the tutorial. Here is what I was working on for the boot image. Its not 100% accurate for what you need, but it does explain a few things.

    1. You need to use wimboot to fix a few evils that MS imposes.
    2. The file name on the end is needed for bios systems
    3. the -n <name> is needed for uefi systems.
    4. You can use the same concepts and even menu for both uefi and bios systems, you just have to be a little sneaky.

    Assume this code snippet is broken because I haven't proved that it works or not.

    kernel tftp://${fog-ip}/wimboot gui
    initrd -n bootx64.efi   tftp://${fog-ip}/boot/bootx64.efi                 bootx64.efi    
    initrd -n bcd           tftp://${fog-ip}/boot/bcd                         bcd
    initrd -n boot.sdi      tftp://${fog-ip}/boot/boot.sdi                    boot.sdi
    initrd -n segmono_boot.ttf tftp://${fog-ip}/boot/fonts/segmono_boot.ttf   segmono_boot.ttf
    initrd -n segoe_slboot.ttf tftp://${fog-ip}/boot/fonts/segoe_slboot.ttf   segoe_slboot.ttf
    initrd -n segoen_slboot.ttf tftp://${fog-ip}/boot/fonts/segoen_slboot.ttf segoen_slboot.ttf
    initrd -n wgl4_boot.ttf tftp://${fog-ip}/boot/fonts/wgl4_boot.ttf         wgl4_boot.ttf
    initrd -n boot.wim      tftp://${fog-ip}/boot/boot.wim                    boot.wim
    boot
    

    If you look at this post you can see how you can dynamically detect between bois and uefi systems. https://forums.fogproject.org/topic/11873/single-ipxe-menu-entry-for-both-bios-uefi

    So for uefi systems you load the uefi kernel and for the bios systems you load the bios winpe kernel.



  • @george1421 It is 405mb


  • Moderator

    @mgrondin Ah OK. I got you, my tutorial only supports bios booting.

    In your case of the error message how large is your boot.wim?



  • @george1421 That is already what i do. I followed your guide to setup the Legacy entry i have.

    My only issue is with getting this to work on a uefi system.

    EDIT: and now i see the other post on uefi systems…This post will probably be useless after i read that facepalm


  • Moderator

    The above method doesn’t work with win10. You CAN boot into winpe, but winpe can’t find the install.wim files because its looking on a local physical device not a memory device. I do have an alternate plan here you can look at: https://forums.fogproject.org/topic/10944/using-fog-to-pxe-boot-into-your-favorite-installer-images/7

    The idea is to boot winpe and connect to a network share that has the win10 installer files on it and then run setup from the network share. This process works.

    FWIW: memdisk only works in bios mode. UEFI mode is not supported by memdisk.


 

407
Online

41.6k
Users

12.1k
Topics

114.4k
Posts