Skip to content

Instantly share code, notes, and snippets.

@mintsoft
Last active January 5, 2024 10:42
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mintsoft/e4bf8391cdc3a9d9014b185897cef41c to your computer and use it in GitHub Desktop.
Save mintsoft/e4bf8391cdc3a9d9014b185897cef41c to your computer and use it in GitHub Desktop.
iPXE + WDS + EFI Boot Menu
@handesonmiller
Copy link

Good trick! But i make and receive the error: Filename:\Boot\iPXE\iPXE.conf
Nothing to boot: No such file or directory
My WS2019 is configured DHCP and WDS roles only.
Sorry for my poor english, thanks from Brazil!

@mintsoft
Copy link
Author

@handesonmiller I don't think you've put the boot.ipxe.cfg in the right place, it needs to be in the Boot\iPXE\iPXE.conf within the WDS remote install folder. You should be able to use pumpkin or another TFTP program to list the contents of the WDS TFTP and check that it is in the correct place.

@handesonmiller
Copy link

handesonmiller commented Aug 26, 2020

Hello again! I followed exactly described in tutorial:
Creating a folder called iPXE in Boot directory on WDS(REMINST), puting snponly.efi, boot.ipxe.cfg and iPXE.conf files including commands described, making the policies to load these files, ordering iPXE configuration first and iPXE Deliver in second, i have attached a image to you:

I will continuing trying to get a iPXE files to load or rewind the processs to the scratch again.

https://imgur.com/q1gBKFI

https://imgur.com/a/ygdYqZM

https://imgur.com/nUYASUM

@handesonmiller
Copy link

I found solution for my problem: Simply set a server name or ip address in op66 on Policy options, now boots menu/debian netinst, i wanna test for other Linux distros, but i found problems to load (Testing Mint 17/18/19) hangs in a half boot process.

@handesonmiller
Copy link

handesonmiller commented Aug 28, 2020

i'm back, sorry for my inconvenience, for linux live boot i need nfs share? Because the boot process (Load initrd and vmlinuz loads perfectly) but i receive the error: Unable to find a medium containing a live filesystem.

@bleier2
Copy link

bleier2 commented Apr 15, 2021

verry nice guide, is there a way to password protect the boot?

@mintsoft
Copy link
Author

@bleier2 Hardly "secure" but you could probably put add something in to the iPXE script to read what a user types in (https://ipxe.org/cmd/read) and then test that it "is the password" (https://ipxe.org/cmd/iseq). Obviously an attacker can download the script and read the password, however they could do that and download the TFTP files etc anyway. If it's just to stop casual messing around (kids in a school etc) then that would probably suffice.

@mintsoft
Copy link
Author

Just FYI, I have duplicated this to https://github.com/mintsoft/iPXE-WDS-EFI-Boot-Menu/ as it's probably easier for discussion etc

@dudefoxlive
Copy link

dudefoxlive commented May 18, 2021

I am assuming that this guide has both WDS and DHCP on the same server. Where I am hoping to set this up DHCP is on a separate server but its still Windows DHCP. In my test lab UEFI is still booting WDS normally instead of loading iPXE. I have followed everything correctly and I don't understand why it is not working. I will provide any info/screenshots that are required to figure out why it is not working.

EDIT: I figured out that if I enable wds to "Not listen on DHCP ports" Everything worked fine and Syslinux boots on legacy and iPXE boots on UEFI. Now to figure out why syslinux is no longer able to boot WDS.

@mintsoft
Copy link
Author

@dudefoxlive I spent quite a while trying to get syslinux to chainboot the WDS when booted EFI. I came to the conclusion that something is just "wrong" between them; hence why I ended up with iPXE snponly. If you do manage it, I'd love to know how you achieved it!

PR welcome: https://github.com/mintsoft/iPXE-WDS-EFI-Boot-Menu/

@MJWexer
Copy link

MJWexer commented Jul 14, 2021

Great guide I too am struggling with syslinux/pxelinux working. I'm trying to get CloneZilla to be bootable from WDS to help my imaging process (and cut down on my insane hoarding and misuse of USB sticks).

I'm stuck testing this on a VM (Hyper-V gen2, secure boot disabled)
With Option 60 'PXEClient' = PXEClient you are right this boots to standard WDS every time, removing the setting results in an error.
Virtual Machine Boot Summary
1. Network Adapter (XXXXXXXXXXX)
- A boot image was not found.
2. SCSI Disk (0,0)
- The boot loader did not load an operating system.

What am I missing?

Also an easy one I'm sure:
url=http://path/to/preseed/file.cfg
I'm missing something here as I cannot locate a preseed.cfg file anywhere

Any help or suggestions are much apricated!

@mintsoft
Copy link
Author

@MJWexer if CloneZilla supports EFI booting it should be as simple as using the same iPXE configuration as I have for the debian installer, but with different files https://github.com/mintsoft/iPXE-WDS-EFI-Boot-Menu/blob/main/REMINST/Boot/iPXE/boot.ipxe.cfg#L60

The preseed is up to you to create, I don't have an example preseed file around as the ones I have are highly network specific however there are docs here: https://wiki.debian.org/DebianInstaller/Preseed and there's an example file here: https://www.debian.org/releases/stable/example-preseed.txt

@Beecha77
Copy link

Hello, so I got it to where it starts to boot the snponly.efi but then it says "Nothing to boot: No such file or directory" I am not sure what I am getting stuck on so any help would be greatly appreciated!
iPXE no boot file

@mintsoft
Copy link
Author

mintsoft commented Sep 29, 2021

@Beecha77

Hello, so I got it to where it starts to boot the snponly.efi but then it says "Nothing to boot: No such file or directory" I am not sure what I am getting stuck on so any help would be greatly appreciated!

I think wither you've not got the iPXE configuration file in the right place (i.e. REMINST\Boot\iPXE\iPXE.conf) or you've not followed the DHCP step 4 properly:

Add policy to deliver the iPXE configuration when iPXE requests it :: At the same level as above, add a new Policy called "iPXE Configuration", add the condition the Vendor Class is PXEClient:Arch:00007 with appended wildcard, change the radio to AND and User Class is iPXE. Set Bootfile name to the path to the iPXE configuration Boot\iPXE\iPXE.conf.

As that error means that iPXE either can't find the file in the right place or that the file doesn't actually exist there.

@Beecha77
Copy link

Beecha77 commented Sep 29, 2021

ok so I did some more research and it looks like the second time it gets assigned an IP address is from my router, not the server. I think that is why it can't see the file in the path because it isn't connected to the right device. I changed my scope so the lowest it would go is 192.168.1.150 but the second IP is 138. I was trying to figure out how to change that but I don't see anything online for windows server DHCP just dnsmasq. Sorry I am new to this DHCP stuff
IP

@mintsoft
Copy link
Author

@Beecha77 Ah that sounds like you have 2 DHCP servers on your network, you need to get it so that only the windows DHCP server is responding, basically the instructions will only work if there's only the one DHCP server on the network and it's the one that's configured with the settings above.

@Beecha77
Copy link

@mintsoft Wow.... I can't believe I didn't think of that. I just went and turned the second off as I don't need it. Everything is loading now thank you for your help on this!

@smtadmin67
Copy link

@mintsoft

Hi, Thank you for this useful article, it's realy work

image

but, can you tell me how can i add background picture for my main menu console?!

when i use the "console" command in my "boot.ipxe.cfg" or "iPXE.conf" after client boot it's say "console command not found"

image

image

image

would you help me?!

@mintsoft
Copy link
Author

mintsoft commented Dec 8, 2022

@smtadmin67 no idea; judging by this: https://forum.ipxe.org/showthread.php?tid=6854 it's not going to be possible

@mahboobrahman
Copy link

mahboobrahman commented Dec 10, 2022

Hello @mintsoft,

Thank you for the useful article. I have WDS + DHCP + DNS+IIS+FTP services running on Windows Server 2019 all in Hyper-V VM, in BIOS mode on a hyper-V VM and I was able to only install Windows OS via WDS in BIOS mode (I could also install Windows OSs in UEFI mode before making the iPXE changes). I followed the steps mentioned above however, I couldn't load the iPXE setup in UEFI mode and it complains about the incorrect directory/URL (Boot\iPXE\iPXE.conf) with the "no such file or directory" error. It appears to download and load the \boot\PXE\snponly.efi file successfully but it can't find the /boot/iPXE/iPXE.conf file for some reason. I have also made the "Alter WDS TFTP to support both \ and / optional changes".
See attached screenshots for the actual error and the environment setup.
wds-uefi-ipxe-error
iPXE-Folder-structure
dchp-options

Do you think you could help? I am not sure what I am missing. Thanks!

@mintsoft
Copy link
Author

@mahboobrahman I've not looked too closely there, however there is definitely a problem that I am aware of with netbooting + Hyper-V VM's. You can only netboot the VM with UEFI if it is Gen 2 (in my experience). I'm guessing you could be hitting into that.

@mahboobrahman
Copy link

@mintsoft Thanks for the help. MY Hyper-V VM is Gen 2 for testing the netbooting/PXE in UEFI mode. It can boot into WDS in UEFI mode using the WDS with dhcp option 3, 60, 66, & 67 (with no additional changes bieng made) and install Windows OSs just fine.
I have Gen 1 VM that I using for Legacy BIOS netbooting and that works well with Windows OSs too. But I am trying to use iPXE or any other utility that could help me install Linux OSs via network.

I am assuming that the server with WDS comes with TFTP path to "remoteinstall/" folder but I am not sure. I tried to change the dhcp policies option 67 (bootfilename) path to HTTP URL but it didn't work either.

@mintsoft
Copy link
Author

@mahboobrahman I'd probably test with more devices (UEFI booting) to see what happens, try with other VM's (like VirtualBox or proxmox etc) so you can see if the issue is HyperV related or not.

@arjanv
Copy link

arjanv commented Jul 6, 2023

Does this work with secure boot enabled on clients?

@mintsoft
Copy link
Author

mintsoft commented Jul 9, 2023

@arjanv no idea, try it and find out?

@jkf1585
Copy link

jkf1585 commented Nov 10, 2023

@mintsoft Would you be so kind as to share your full boot.ipxe.cfg file? I'm struggling getting Ubuntu 22.04 to install. Debian is fine.

Would be much appreciated.

@mintsoft
Copy link
Author

@jkf1585
Copy link

jkf1585 commented Nov 10, 2023

@mintsoft That's where my original config file came from. Thank you. I'm asking how you, personally, have your setup to allow Ubuntu and Mint installs. Thank you.

image

@jkf1585
Copy link

jkf1585 commented Nov 10, 2023

@mintsoft You're good for two things: 1) No good & 2) good for nothin'
:)
I'll be nice & say thanks, anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment