Netboot.xyz: your favorite operating systems in one place
netboot.xyz
netboot.xyz
Then there's mention of DHCP and self hosting. Do I need to have some service running within my LAN first or can this go right out to some public server and boot from images there? How does DHCP factor in? I am in so far over my head on this but it seems interesting and something fun to try out.
Edit: Seriously? You click on docs and almost all of those questions are answered. It's 1 click away. Parent didn't even try.
However you do it, once iPXE starts running, it will take control of the NIC and fetch the actual OS images that it needs from the internet over HTTP.
I am sure there are other implementations I have only seen it on HP servers so far.
Typically, the network card contains a basic PXE kernel. To enhance this environment, you can chainload iPXE, which offers a broader range of features. iPXE allows for more advanced booting options, such as loading scripts or initiating an unattended installation directly from the network.
Generally speaking, if you have iPXE already compiled and flashed onto your NIC, then you can follow these instructions: https://netboot.xyz/docs/booting/ipxe
DHCP is only needed for getting an IP address. You can use the Docker image with the proper DHCP parameters to load it automatically when using PXE/iPXE: https://netboot.xyz/docs/docker
In order to find where the image is, you need some kind of discovery mechanism. This is where DHCP comes in. Remember this is all happening before you have an OS, so it has to be very bare bones
iPXE [1] is an open-source implementation of PXE, and much more -- it's much more flexible, it supports additional protocols including HTTP(S) and DNS, it has configuration and scripting options, a basic command-line interface, etc. In order to run iPXE, you need to boot an iPXE image somehow -- e.g. from a MBR or EFI image on a disk drive or USB drive (or even over PXE, I guess). But because iPXE supports more protocols and more configuration, you don't need to set up TFTP and DHCP, and it can chainload into e.g. an EFI image or a Linux kernel instead of being limited to booting images in the PXE format.
An example of iPXE in the wild is the Arch Linux netboot image [2]. They provide pre-configured iPXE images that display an interactive menu to select a mirror, download the Arch Linux installer, and boot it. (It's really convenient since you can just drop the UEFI image at "/efi/boot/bootx64.efi" on a FAT32 thumb drive instead of having to download the whole installer image and 'dd' it onto the drive.)
The submitted project, netboot.xyz, is a similar idea: a preconfigured build of iPXE that lets you interactively download and boot installers for many popular operating systems from a single image.
[0]: https://en.wikipedia.org/wiki/Preboot_Execution_Environment
[1]: https://ipxe.org/
This is super common actually! Most built-in PXE only supports TFTP, which is pretty slow compared to TCP-based stuff. It can make sense to use the built-in PXE to grab a (small) iPXE image over TFTP, then have iPXE grab the (big) real image over HTTP(S). This is also useful if you want to store your main image on something like S3 that doesn’t support TFTP.
For a while I had a script that would create iPXE images dynamically on the fly with the correct HTTPS URL and auth information embedded in them.
Specifically there are particular DHCP options (66, 67) that tell the client about this, and the client software (PXE) understands them:
* https://datatracker.ietf.org/doc/html/rfc2132
* https://www.iana.org/assignments/bootp-dhcp-parameters/bootp...
* https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-pa... (RFC 5970)
And while the options previously were interpreted for TFTP use, newer PXE software now understands the use of "http[s]://" in the file name and use that instead of TFTP.
Off topic, but does anyone know a good resource that explains how to correctly use "e.g."? (I've looked before, but didn't find one)
While I may seem like a grammar pedant, there are many things that have entered common use while arguably incorrect that I'm not so bothered about ("That begs the question", for example). However while this (incorrect) use of "e.g." is a hill I will die on, even so, I struggle to explain why it's just plain wrong. (It can be used to replace "for example" when preceding a list if examples that illustrate a point, but not as a generic replacement as in this case.)
Someone somewhere must have explained it better...
I think you've already understood it.
I think a secondary argument could be made that i.e. and e.g. are typically used to clarify something in a second clause; e.g., "it can chainload into any form of boot image (e.g., an EFI image or a Linux kernel) rather than being restricted to the PXE image format".
I would recommend picking up a copy of CMOS if you are in want of good ways to explain English grammar. English is my secondary language, and it's occasionally helpful for me to have access to a reference for its grammar when I struggle with understanding a concept. Just keep in mind that languages are bendable and any guide is descriptive and not prescriptive for informal communication.
Are there many such things you would die for without even knowing why? :)
"Exempli gratia" translates quite literally to "for the sake of example". I see no grammatical reasons why you shouldn't use it as the GP used it.
Are you sure you are not mistaking e.g. with i.e.? The latter stands for "id est" and means "that is", but the two are often confounded, and it's not unusual to find i.e. used to introduce an example. If the GP had used i.e., that would be a hill to die on.
I didn't say I don't know why. I said that finding good reference material to explain it is hard to find.
> Are you sure you are not mistaking e.g. with i.e.?
Yes, I'm sure. I'm surprise that if you know the difference, you don't know the correct usage.
For my data center servers, I have it booting via PXE to an iPXE with a custom script to take a unique identifier from the host and build the corresponding configuration (NixOS). So essentially for that I define my NixOS configuration in a NixOS flake and plug the new host in and it will boot to the correct configuration. I actually don't have any OS installation on most of the hosts and share the nix store via NFS.
I also keep an iPXE thumb drive around in case I need to do this for something not on my network. In that case, I insert the drive, boot from it, and then ask it to boot from netboot.xyz manually.
> Lets say I want to boot a random old PC from one of these images - does the bios need to have iPXE support? Or PXE?
The most-desirable way to use iPXE is to boot it from a system's built-in PXE, chainloading it from a local DCHP+TFTP server. All routers have a DHCP server, and many enthusiast/professional routers will have a TFTP server available. pfSense/OPNSense for example can both do this.
If you want to go down the rabbit hole and can mod your system BIOS, you can install iPXE into many of them. I wouldn't recommend it, but I did it once and thought it was pretty cool.
> random old PC
If you _literally_ meant like a vintage PC that predates the PXE spec[1], you can boot iPXE from any local media — I architected a project 10 years ago where I actually gave floppy disks to technicians because some of the ancient Dells we were working with required a BIOS update to enable USB booting.
You can also burn iPXE into a network card's ROM chip. There were a lot of PCI/ISA network cards that took an EEPROM and could boot from them if populated. I always thought it would be fun to boot a vintage PC with iPXE straight off of an add-in network card like that. iPXE will hook the BIOS, and you can literally boot MS-DOS via iSCSI.
> Do I need to have some service running within my LAN first or can this go right out to some public server and boot from images there?
Again, typical deployments will have iPXE chainloaded from the system's existing PXE implementation, which means you've got a DHCP server on the local segment, and a TFTP server somewhere on the local network. But you _could_ boot iPXE from any other boot medium, which would mean the DHCP/TFTP setup are not required. iPXE itself, once loaded, can do its work with any network connection.
[1]: https://en.wikipedia.org/wiki/Wired_for_Management - this happened in 1998/1999 and implementation was widespread by 2001 or so.
Firewalling the application so that only local images are available seems like the only safe way to use this.
(The limitation here is that you have to be able to load the installer image into RAM, which does exclude a lot of smaller nettop/thin/SoC clients unfortunately.)
How is that different than pulling an ISO image of your favorite distro, or using a package manager like apt?
Yes, I know that Linux ISOs have checksums and apt uses digital signatures, but so does iPXE. The only difference here would be that for some reason you trust the websites of your Linux distro vendor, but not netboot.xyz?
Well... yeah... that's not that crazy of a position to take.
Not saying there's anything wrong with netboot.xyz, but it's a question of how many cooks to let in the kitchen, and how many public eyes are on each cook.
"Some" reason? I think I'd have a very good reason to place much more trust in the Debian folks than some guy who runs some random netbooting website.
"Some iPXE builds do not support HTTPS connections. If you get an "Operation not supported" error message, run this instead:
chain --autofree http://boot.netboot.xyz"
Which.. think about that advice for a minute.
I'm not going to lie, this made me laugh out loud.
"For some reason, you trust a doctor to perform surgery on you, but not this lovely man that I met on the subway?!"
I did at one point keep a few stock images on my tftp server but even there, they would go out of date quicker than my need to use them. So I ended up sticking with NetBoot.xyz for convenience
Brilliant work on a brilliant solution.
https://www.iventoy.com/en/index.html
I haven't tried it but I use its USB cousin Ventoy almost every day. It's fantastic.
In my experience, TFTP is really slow (ancient UDP based protocol) and I'd like to do away with it. Unfortunately TFTP is still required to load something like iPXE to load the actual OS Kernel over HTTP, assuming iPXE isn't part of the NIC firmware or can't be configured to do so.
Turns out that downloading over HTTP is just as slow (few MB/s) when using iPXE so I'm not sure what I'm gaining.
Ideally HTTP boot is possible through the UEFI bios but it seems that this is common on servers, but not on clients? My HP 1L PCs don't have an option to boot over HTTP directly.
iPXE should be able to max out any gigabit NIC that has a decent driver. If you're using a BIOS UNDI driver (undionly.kpxe) or EFI SNP (snp.efi/snponly.efi) you may be experiencing the misery of a crummy driver supplied by the built-in PXE ROM.
If your NIC is supported, try using the bin/ipxe.pxe or bin/ipxe.efi build targets[1] and chainload that instead. If they work at all, it'll mean you've got a NIC with a native iPXE driver, and using that driver may speed things up.
Alternatively, the opposite may also be true. Some of the drivers aren't great, and UNDI/SNP may perform better. If you're already using those builds, try it the other way around.
If that's the case, then OS'es which do not use any local storage devices, and instead mount remote filesystems over the network -- can't be far behind...
And, if that's the case, then the only thing that the local PC is doing is using its CPU and RAM to run the OS, and network port to read/write data to the filesystem...
But the local PC could also simply run a Remote Desktop or VMWare Client or VNC or equivalent to another remote computer somewhere else on the Internet -- in which case it really doesn't even need to run its own Operating System proper, it only needs to run the software which allows network connectivity to the running instance of the remote Operating System somewhere else on the Internet...
Maybe it would be simpler to build a future "computer" which is basically the glorified equivalent of a long-distance KVM switch over the Internet with local video output...
Hey, such a device would never need its own hardware upgrades... just upgrade whatever remote machine it connects to on the other end, and you've effectively upgraded the local one...
Anyway, an interesting concept!
https://netboot.xyz/docs/faq/#operating-systems
looks like you can use it on aws / ec2:
But for system rescue purposes, Ventoy still wins. You bring your own boot images, which could be arbitrary ISOs, and don't have to worry about networking availability.