PXE

This page is about using Gentoo as a PXE server to boot just about any operating system or bootable tool. Please extend it with your own experience. The primary focus is to boot live images and the page can get renamed once we have a better name for it.

TFTP server
Create TFTP root directory, this is where the chosen bootloader will be served from. Also make owned by a user to not have to be root to do modifications

Then chose TFTP server, pick one of these:

atftp
One of the easiest TFTP servers to setup on Gentoo is.

Add to default startup, and start service

tftp-hpa
Many have best experience with.

To run it temporarily, use the following command line.

Bootloaders
The article about Diskless nodes contains plenty of useful information on how to setup a PXE environment.

GRUB2
For client configuration, see for example: Setup PXE boot with EFI Using Grub2 from openSUSE kiwi

You probably already have installed verify that it was installed with GRUB_PLATFORMS ,  ,

Next "install" needed grub files to

iPXE
There is a few different options to get the iPXE bootloaders

The quickest way:

But building from source (highly recommended from iPXE folks) is not hard, and allows for easy modifications.

Verify that some needed dependencies is installed:

Package can be used, but needs USE flags such as ,   and still does not give all files we want.

PXELINUX
Exists as in portage and can be installed with

And copy over needed files to our this is only basic files for pcbios kernel boot, other files might be needed for other platforms

Gentoo installation
See Installation Alternatives - Diskless install using PXE for a guide on Gentoo.

Some projects exists to help setup such environment
 * numberly/gentoo-pxe-builder with focus on Pxelinux and SSH automation for installation
 * NiKiZe/Gentoo-iPXE with focus on iPXE

Fedora installation
The following script creates a TFTP directory tree, downloads kernel and initrd images from a Fedora mirror and configures a netbootable instance of GRUB.

Adjust it to your needs and then run it without parameters.

Now you just need to configure TFTP and DHCP so that  is available to the netbooted machine and it that it requests   via TFTP.

Ubuntu installation
To install Ubuntu to a device via PXE, simply download an Ubuntu netboot image for the appropriate architecture. Note that most of the files in the release and architecture-specific directory are unnecessary, you simply need  (about 40MB).

Extract that file to an appropriate TFTP-served directory and configure your DHCP server with the  directive to point at   for the machine or subnet in question.

Note that you will also need to give the host(s) internet access as the netboot images are configured to pull packages down from the internet.