Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to boot with iscsi in UEFI env?
2019-01-27, 03:40
Post: #37
RE: How to boot with iscsi in UEFI env?
(2019-01-26 18:30)scan80269 Wrote:  
(2019-01-26 17:24)psychrabi Wrote:  
(2019-01-26 05:56)scan80269 Wrote:  On my system acting as iSCSI disk server (running Windows Server 2012 R2/2016/2019 OS - with iSCSI Target Server feature enabled) I set up Tiny PXE Server to load ipxe-snponly-x86-64.efi (64-bit UEFI iPXE) for UEFI clients network booting via PXE. Once a client boots to iPXE, my iPXE script launches sanboot of an iSCSI virtual disk based on Ethernet MAC address match to initiate Win10 OS boot. The iSCSI virtual disk for the client is set up with GPT style disk partitions to properly support Win10 booting in UEFI mode (a Win10 requirement by Microsoft).

My iPXE script is set up such that sanboot of a virtual disk will fail if it doesn't have Win10 properly installed, in which case the script will continue onto launching wimboot to boot the client into WinPE in preparation for over-the-network Win10 OS installation into the iSCSI virtual disk dedicated to that client. I created a small (10GB) iSCSI virtual disk to carry the Win10 OS installation files, to avoid having to plug a USB flash drive into the client.

On many modern PCs, in order for UEFI PXE to work, "legacy" support (a.k.a. CSM - Compatibility Support Module) needs to be disabled in BIOS setup.

Once you can get a UEFI client to chain boot from PXE to iPXE, the rest, such as using sanboot to boot Win10 should be relatively straightforward.

If possible could you share the pxe script with me and the tiny pxe settings.
i want to try it once..

Also about the disabling the legacy support, does it mean we have to put the client to exclusive UEFI mode ?

It may depend on the client motherboard. Some systems like the Intel NUCs I use allow independent control of UEFI & legacy support, but whenever legacy support is enabled, the system will default to legacy PXE boot, so to get a NUC to do UEFI PXE boot, the legacy support option must be explicitly disabled. The PXE boot screens for UEFI and legacy typically look quite different, so it should be easy to tell which type of PXE boot the system is set to do.

Here's a sample iPXE script:

#!ipxe

#ifopen net0
#dhcp
set net0/gateway 0.0.0.0
echo IP: ${net0/ip}, Gateway: ${net0/gateway}
echo MAC address: ${mac}
set srvname iSCSIServer
set boot-url http://${next-server}
set keep-san 1
cpuid --ext 29 && set arch x64 || set arch x86
echo Platform type: ${platform}
echo Arch: ${arch}
echo ${platform}_${buildarch}
echo
prompt --timeout 5000 Press any key to continue ||
goto ${platform}_${buildarch} || goto unknown

:pcbios_x86_64
:efi_i386
echo This ${platform}_$(buildarch} PC is currently not supported!
goto exit

:pcbios_i386
iseq ${mac} b8:ae:ed:7d:8b:3f && sanboot iscsi:${next-server}::::iqn.1991-05.com.microsoft:${srvname}-win10rs4-6i5syh-target ||
iseq ${mac} 54:b2:03:15:03:8b && sanboot iscsi:${next-server}::::iqn.1991-05.com.microsoft:${srvname}-win10rs4-7i5dnhe-target ||
goto WinPEboot

:efi_x86_64
iseq ${mac} b8:ae:ed:7d:8b:3f && sanboot iscsi:${next-server}::::iqn.1991-05.com.microsoft:${srvname}-win10rs5-6i5syh-gpt-target ||
iseq ${mac} 54:b2:03:15:03:8b && sanboot iscsi:${next-server}::::iqn.1991-05.com.microsoft:${srvname}-win10rs5-7i5dnhe-gpt-target ||

:WinPEboot
# Mount OS install disk if all sanboot to OS attempts fail
sanhook --drive 0x81 iscsi:${next-server}::::iqn.1991-05.com.microsoft:${srvname}-win10rs5-install-target ||
echo
prompt Press any key to boot WinPE

# wimboot WinPE to prepare for OS installation
kernel ${boot-url}/wimboot gui
initrd -n segmono_boot.ttf ${boot-url}/Boot/fonts/segmono_boot.ttf segmono_boot.ttf ||
initrd -n segoe_slboot.ttf ${boot-url}/Boot/fonts/segoe_slboot.ttf segoe_slboot.ttf ||
initrd -n segoen_slboot.ttf ${boot-url}/Boot/fonts/segoen_slboot.ttf segoen_slboot.ttf ||
initrd -n wgl4_boot.ttf ${boot-url}/Boot/fonts/wgl4_boot.ttf wgl4_boot.ttf ||
iseq ${platform} pcbios && initrd -n bootmgr ${boot-url}/bootmgr bootmgr ||
iseq ${platform} efi && initrd -n bootx64.efi ${boot-url}/bootx64.efi bootx64.efi ||
initrd -n bcd ${boot-url}/Boot/BCD bcd ||
initrd -n boot.sdi ${boot-url}/Boot/boot.sdi boot.sdi ||
initrd -n boot.wim ${boot-url}/Boot/boot.wim boot.wim ||
boot

:unknown
echo Unknown platform ${platform}_${buildarch}

:exit
Prompt Press a key to exit

Here's a sample config.ini for Tiny PXE Server:

[arch]
;will over rule the bootp filename or opt67 if the client arch matches one of the below
;00006=bootia32.efi
;00007=bootx64.efi
00007=ipxe-snponly-x86-64.efi
;00007=ipxe-x86_64.efi
;00009=bootx64.efi
[dhcp]
;needed to tell TFTPd where is the root folder
root=E:\pxesrv\files\
;bootp filename as in http://tools.ietf.org/html/rfc951
filename=ipxe-undionly.kpxe
;filename=ipxe-snponly-x86-64.efi
;alternative bootp filename if request comes from ipxe or gpxe
altfilename=BIOSnUEFI.ipxe
;start HTTPd
httpd=1
binl=0
start=0
dnsd=0
proxydhcp=1
;default=1
bind=1
;tftpd=1 by default
;will share (netbios) the root folder as PXE
smb=0
;will log to log.txt
log=0
;opt1=
;opt3=
;opt6=
;opt28=
;opt15=
;opt17=
;opt43=
;opt51=
;opt54=
;opt67=
;opt66=
;opt252=
poolstart=192.168.0.106
poolsize=0
;alternative bootp filename if request comes thru proxydhcp (udp:4011)
;proxybootfilename=
;any extra dhcp options
;my gpxe / ipxe dhcp options
optextra=175.6.1.1.1.8.1.1
;the below will be executed when clicking on the online button
;cmd=_test.bat
;if log=1, will log to log.txt
log=0
opt1=255.255.255.0
opt3=192.168.0.1
opt6=192.168.0.1
opt28=192.168.0.255
opt43=0
opt51=3600
opt54=192.168.0.105
next-server=192.168.0.105
opt60=PXEClient
opt66=192.168.0.105
opt17=
opt67=ipxe-undionly.kpxe
[frmDHCPServer]
top=10
left=968
[frmAbout]
top=486
left=509

Thank you.
I will have a go at it today.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to boot with iscsi in UEFI env? - psychrabi - 2019-01-27 03:40



User(s) browsing this thread: 6 Guest(s)