Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (2024)

“PXE is a protocol used to boot operating systems over the network. You can use this method to install your favorite Linux distribution on your laptop, desktop, or server via PXE over the network.

In this article, I am going to show you how to configure Ubuntu 22.04 LTS as a PXE boot server, and PXE boot Ubuntu Desktop 22.04 LTS Live installer on a computer on the network so that you can install it without needing a CD/DVD drive or USB thumb drive. So, let’s get started.”

  1. Network Topology
  2. Setting Up a Static IP Address on Ubuntu Server 22.04 LTS
  3. Setting Up a Static IP Address on Ubuntu Desktop 22.04 LTS
  4. (Optional) Preparing Ubuntu Desktop 22.04 LTS for Installing a DNS Server
  5. Creating the Required Directory Structure
  6. Downloading iPXE Source Code and Compiling iPXE on Ubuntu 22.04 LTS
  7. Copying the Compiled iPXE Firmwares to /pxeboot/firmware Directory
  8. Installing and Configuring a DHCP and TFTP Server on Ubuntu 22.04 LTS
  9. Installing and Configuring NFS Server on Ubuntu 22.04 LTS
  10. Configuring iPXE to PXE Boot Ubuntu Desktop 22.04 LTS Live Installer
  11. PXE Booting Ubuntu Desktop 22.04 LTS Live Installer
  12. Configuring iPXE to PXE Boot Other Linux Distributions
  13. Conclusion
  14. References

Network Topology

I will configure an Ubuntu 22.04 LTS machine (PXE-Boot-Server) as a PXE boot server using the iPXE firmware. The PXE boot server will also work as a DHCP and TFTP server. These are required for the PXE boot to work. Just to demonstrate how everything works, I will show you how to configure the PXE boot server to PXE boot Ubuntu Desktop 22.04 LTS Live installer on a computer (PXE-Client) so that you can install Ubuntu Desktop 22.04 LTS on it without needing any CD/DVD drive or USB thumb drive.
Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (1)

Setting Up a Static IP Address on Ubuntu Server 22.04 LTS

Before you go any farther, it’s best to configure the PXE boot server with a fixed/static IP address. In this section, I am going to show you how to set up a static/fixed IP address on Ubuntu Server 22.04 LTS.

To configure a fixed/static IP address on Ubuntu Server 22.04 LTS , open the netplan configuration file /etc/netplan/00-installer-config.yaml with the nano text editor as follows:

$ sudo nano /etc/netplan/00-installer-config.yaml

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (2)

By default, DHCP is enabled for the network interface ens33, as you can see in the screenshot below.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (3)

To set a static/fixed IP address 192.168.0.130 (also /24 netmask, gateway address 192.168.0.1, and DNS nameservers 1.1.1.1 and 8.8.8.8), change the configuration of the ens33 network interface as follows. Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the netplan configuration file.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (4)

To apply the changes, run the following command:

$ sudo netplan apply

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (5)

A static/fixed IP address 192.168.0.130 should be set on the ens33 network interface, as you can see in the screenshot below.

$ ip a

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (6)

You should also be able to resolve DNS names to IP addresses, as you can see in the screenshot below.

$ ping -c3 google.com

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (7)

Setting Up a Static IP Address on Ubuntu Desktop 22.04 LTS

Even if you’re using Ubuntu Desktop 22.04 LTS instead of Ubuntu Server 22.04 LTS for setting up a PXE boot server, it will still be a good idea to set up a fixed/static IP address on your computer. In this section, I am going to show you how to set up a static/fixed IP address on Ubuntu Desktop 22.04 LTS.

To find the name of the currently active Network Manager connection, run the following command:

$ nmcli connection show

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (8)

The name of the currently active Network Manager connection is Wired connection 1.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (9)

To set a static/fixed IP address 192.168.0.130 (also /24 netmask, gateway address 192.168.0.1, and DNS nameservers 1.1.1.1 and 8.8.8.8) for the Network Manager connection Wired connection 1, run the following command:

$ nmcli connection modify "Wired connection 1" ipv4.method manual ipv4.addresses 192.168.0.130/24 gw4 192.168.0.1 ipv4.dns 1.1.1.1,8.8.8.8

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (10)

For the changes to take effect, run the following command:

$ nmcli connection up "Wired connection 1"

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (11)

A static/fixed IP address 192.168.0.130 should be set on the ens33 network interface, as you can see in the screenshot below.

$ ip a

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (12)

You should also be able to resolve DNS names to IP addresses, as you can see in the screenshot below.

$ ping -c3 google.com

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (13)

(Optional) Preparing Ubuntu Desktop 22.04 LTS for Installing a DNS Server

On Ubuntu Desktop 22.04 LTS, NetworkManager will run a systemd-resolved service which will act as a local DNS cache server. The systemd-resolved service uses the UDP port 53, the same as dnsmasq. So, as long as the systemd-resolved service is running, dnsmasq will not work. If you’re using Ubuntu Desktop 22.04 LTS for setting up a PXE boot server, you have to disable and stop the systemd-resolved service before installing/running dnsmasq.

To stop the systemd-resolved service, run the following command:

$ sudo systemctl stop systemd-resolved

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (14)

Also, remove the systemd-resolved service from the system startup so that it does not start automatically at boot time anymore.

$ sudo systemctl disable systemd-resolved

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (15)

Remove the symbolic link of the /etc/resolv.conf file with the following command:

$ sudo unlink /etc/resolv.conf

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (16)

Create a new /etc/resolv.conf file with the nano text editor as follows:

$ sudo nano /etc/resolv.conf

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (17)

Type in the following lines in the /etc/resolv.conf file.

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the /etc/resolv.conf file.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (18)

You should also be able to resolve DNS names to IP addresses again, as you can see in the screenshot below.

$ ping -c3 google.com

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (19)

Creating the Required Directory Structure

In this section, I will create all the required directories for PXE booting (using the iPXE firmware) to work.

I have planned the directory structure as follows:

/pxeboot

  • config/
  • firmware/
  • os-images/

In the /pxeboot/config/ directory, I will store all the iPXE boot configuration files.

In the /pxeboot/firmware/ directory, I will store all the iPXE boot firmware files.

In the /pxeboot/os-images/ directory, I will create a separate subdirectory for each of the Linux distributions (that I want to PXE boot) and store the contents of the ISO images of these Linux distributions there. For example, for PXE booting Ubuntu Desktop 22.04 LTS, you can create a directory ubuntu-22.04-desktop-amd64/ in the /pxeboot/os-images/ directory and store the contents of the Ubuntu Desktop 22.04 LTS ISO image in that directory.

To create all the required directory structures, run the following command:

$ sudo mkdir -pv /pxeboot/{config,firmware,os-images}

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (20)

All the required directory structures for PXE booting should be created.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (21)

Downloading iPXE Source Code and Compiling iPXE on Ubuntu 22.04 LTS

In this section, I am going to show you how to download the iPXE source code and compile it on Ubuntu 22.04 LTS so that we can use it for PXE booting.

First, update the APT package repository cache with the following command:

$ sudo apt update

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (22)

To install the required build dependencies for iPXE, run the following command:

$ sudo apt install build-essential liblzma-dev isolinux git

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (23)

To confirm the installation, press Y and then press <Enter>.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (24)

All the required packages will be downloaded from the internet. It will take a while to complete.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (25)

Once the packages are downloaded, they will be installed one by one. It will take a few seconds to complete.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (26)

At this point, all the required dependency packages should be installed.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (27)

Now, navigate to the ~/Downloads directory as follows:

$ cd ~/Downloads

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (28)

Clone the iPXE GitHub repository on your Ubuntu 22.04 LTS machine as follows:

$ git clone https://github.com/ipxe/ipxe.git

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (29)

The iPXE GitHub repository should be cloned.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (30)

A new directory ipxe/ should be created in the ~/Downloads directory, as you can see in the screenshot below.

$ ls -lh

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (31)

Navigate to the ipxe/src/ directory as follows:

$ cd ipxe/src

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (32)

You should see a lot of directories there containing the iPXE source code.

$ ls -lh

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (33)

To configure iPXE to automatically boot from an iPXE boot script stored in the /pxeboot/config/ directory of your computer, you will need to create an iPXE boot script and embed it with the iPXE firmware when you compile it.

Create an iPXE boot script bootconfig.ipxe and open it with the nano text editor as follows:

$ nano bootconfig.ipxe

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (34)

Type in the following lines of codes in the bootconfig.ipxe file.

#!ipxe

dhcp

chain tftp://192.168.0.130/config/boot.ipxe

Once you’re done, save the file by pressing <Ctrl> + X followed by Y and <Enter>.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (35)

NOTE: Here, 192.168.0.130 is the IP address of my Ubuntu 22.04 LTS machine that I am configuring as a PXE boot server (PXE-Boot-Server). It will be different for you.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (36)

To compile iPXE BIOS and UEFI firmwares and embed the bootconfig.ipxe iPXE boot script in the compiled firmwares, run the following command:

$ make bin/ipxe.pxe bin/undionly.kpxe bin/undionly.kkpxe bin/undionly.kkkpxe bin-x86_64-efi/ipxe.efi EMBED=bootconfig.ipxe

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (37)

The iPXE boot firmware files for BIOS and UEFI systems are being compiled. It will take a few seconds to complete.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (38)

The iPXE boot firmware files for BIOS and UEFI systems are being compiled…

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (39)

The iPXE boot firmware files for BIOS and UEFI systems are compiled at this point.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (40)

Copying the Compiled iPXE Firmwares to /pxeboot/firmware Directory

Once the iPXE boot firmware files are compiled, copy them to the /pxeboot/firmware directory of your Ubuntu 22.04 LTS PXE boot server so that the PXE client computers can access them via TFTP.

$ sudo cp -v bin/{ipxe.pxe,undionly.kpxe,undionly.kkpxe,undionly.kkkpxe} bin-x86_64-efi/ipxe.efi /pxeboot/firmware/

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (41)

The iPXE boot firmware files should be copied to the /pxeboot/firmware directory.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (42)

Once the iPXE boot firmware files are copied to the /pxeboot/firmware directory, the directory structure of the /pxeboot directory should look as shown in the screenshot below.

Here, the iPXE boot firmware files ipxe.pxe, undionly.kpxe, undionly.kkpxe, and undionly.kkkpxe are for PXE booting on BIOS systems. The iPXE boot firmware file ipxe.efi is for PXE booting on UEFI systems.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (43)

For more information on the iPXE boot firmware files, read the Compiling iPXE for BIOS-Based Motherboards and Compiling iPXE for UEFI-Based Motherboards sections of the article How to Configure Synology NAS as PXE Boot Server for Netbooting Linux Installation Images with iPXE (BIOS and UEFI version) at linuxhint.com.

Installing and Configuring a DHCP and TFTP Server on Ubuntu 22.04 LTS

For PXE boot to work, you will need a working DHCP and TFTP server running on your computer. There are many DHCP and TFTP server software. But, in this article, I will use dnsmasq. dnsmasq is mainly a DNS and DHCP server that can also be configured as a TFTP server.

On Ubuntu 22.04 LTS, dnsmasq is not installed by default. But it is available in the official package repository of Ubuntu 22.04, and you can install it with the APT package manager very easily.

To install dnsmasq on Ubuntu 22.04 LTS, run the following command:

$ sudo apt install dnsmasq -y

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (44)

dnsmasq should be installed.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (45)

We will create a new dnsmasq configuration file. So, rename the original /etc/dnsmasq.conf file to /etc/dnsmasq.conf.backup as follows:

$ sudo mv -v /etc/dnsmasq.conf /etc/dnsmasq.conf.backup

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (46)

Create an empty dnsmasq configuration file /etc/dnsmasq.conf with the following command:

$ sudo nano /etc/dnsmasq.conf

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (47)

Type in the following lines in the dnsmasq configuration file /etc/dnsmasq.conf:

interface=ens33

bind-interfaces

domain=linuxhint.local

dhcp-range=ens38,192.168.0.180,192.168.0.200,255.255.255.0,8h

dhcp-option=option:router,192.168.0.1

dhcp-option=option:dns-server,1.1.1.1

dhcp-option=option:dns-server,8.8.8.8

enable-tftp

tftp-root=/pxeboot

# boot config for BIOS systems

dhcp-match=set:bios-x86,option:client-arch,0

dhcp-boot=tag:bios-x86,firmware/ipxe.pxe

# boot config for UEFI systems

dhcp-match=set:efi-x86_64,option:client-arch,7

dhcp-match=set:efi-x86_64,option:client-arch,9

dhcp-boot=tag:efi-x86_64,firmware/ipxe.efi

The final configuration file should look as shown in the screenshot below.

To save the dnsmasq configuration file /etc/dnsmasq.conf, press <Ctrl> + X followed by Y and <Enter>.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (48)

Here, ens33 is the name of the network interface for which DHCP is enabled¹.

I have configured the DHCP server to assign IP addresses in the range 192.168.0.180-192.168.0.200 on the PXE boot clients. The router/gateway address is 192.168.0.1. The DNS servers are 1.1.1.1 and 8.8.8.82.

NOTE: If you don’t know the name of the network interface of your Ubuntu 22.04 LTS machine, you can run the ip a command to find it out.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (49)

These 2 sections are used to detect whether a PXE client is BIOS-based or UEFI-based.

If a PXE client is BIOS-based, the DHCP server serves the iPXE firmware file /pxeboot/firmware/ipxe.pxe¹.

If a PXE client is UEFI-based, the DHCP server serves the iPXE firmware file /pxeboot/firmware/ipxe.efi².

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (50)

For the changes to take effect, restart the dnsmasq server as follows:

$ sudo systemctl restart dnsmasq

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (51)

To check whether the dnsmasq service is running, run the following command:

$ sudo systemctl status dnsmasq

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (52)

As you can see, the dnsmasq service is running. So, it’s configured correctly.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (53)

Installing and Configuring NFS Server on Ubuntu 22.04 LTS

Ubuntu Desktop 22.04 LTS uses casper to boot into Live installation mode. casper supports PXE boot via the NFS protocol only. Other Linux distributions like Fedora, CentOS/RHEL also support PXE booting via the NFS protocol. So, to boot Ubuntu Desktop 22.04 LTS and many other Linux distributions via PXE, you need to have a fully functional NFS server accessible over the network.

To install the NFS server on Ubuntu 22.04 LTS, run the following command:

$ sudo apt install nfs-kernel-server

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (54)

To confirm the installation, press Y and then press <Enter>.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (55)

NFS server should be installed.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (56)

Open the NFS server configuration file /etc/exports as follows:

$ sudo nano /etc/exports

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (57)

To share the /pxeboot directory via NFS, add the following line at the end of the /etc/exports file:

/pxeboot *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the NFS configuration file /etc/exports.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (58)

To make the new NFS share /pxeboot available, run the following command:

$ sudo exportfs -av

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (59)

Configuring iPXE to PXE Boot Ubuntu Desktop 22.04 LTS Live Installer

In this section, I am going to show you how to configure iPXE on your Ubuntu 22.04 LTS PXE boot server to PXE boot Ubuntu Desktop 22.04 LTS Live installer on other computers (PXE clients).

NOTE: If you want to configure iPXE on your Ubuntu 22.04 LTS PXE boot server to PXE boot other Linux distributions, you will have to make the necessary changes. This shouldn’t be too hard.

First, navigate to the ~/Downloads directory of your Ubuntu 22.04 LTS PXE boot server as follows:

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (60)

To download the Ubuntu Desktop 22.04 LTS ISO image from the official website of Ubuntu, run the following command:

$ wget https://releases.ubuntu.com/jammy/ubuntu-22.04-desktop-amd64.iso

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (61)

The Ubuntu Desktop 22.04 LTS ISO image is being downloaded. It will take a while to complete. I have already downloaded it. So, I won’t waste my time redownloading it here.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (62)

Once the Ubuntu Desktop 22.04 LTS ISO image file ubuntu-22.04-desktop-amd64.iso is downloaded, you should find it in the ~/Downloads directory of your PXE boot server.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (63)

Mount the Ubuntu Desktop 22.04 LTS ISO file ubuntu-22.04-desktop-amd64.iso in the /mnt directory as follows:

$ sudo mount -o loop ~/Downloads/ubuntu-22.04-desktop-amd64.iso /mnt

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (64)

Create a dedicated directory ubuntu-22.04-desktop-amd64/ for storing the contents of the Ubuntu Desktop 22.04 LTS ISO image in the /pxeboot/os-images/ directory as follows:

$ sudo mkdir -pv /pxeboot/os-images/ubuntu-22.04-desktop-amd64

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (65)

To copy the contents of the Ubuntu Desktop 22.04 LTS ISO image in the /pxeboot/os-images/ubuntu-22.04-desktop-amd64/ directory with rsync, run the following command:

$ sudo rsync -avz /mnt/ /pxeboot/os-images/ubuntu-22.04-desktop-amd64/

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (66)

NOTE: If you don’t have rsync installed on Ubuntu 22.04 LTS and need any assistance in installing rsync on Ubuntu 22.04 LTS, read the article How to Use rsync Command to Copy Files on Ubuntu.

The contents of the Ubuntu Desktop 22.04 LTS ISO image are being copied to the /pxeboot/os-images/ubuntu-22.04-desktop-amd64/ directory. It will take a while to complete.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (67)

At this point, the contents of the Ubuntu Desktop 22.04 LTS ISO image should be copied to the /pxeboot/os-images/ubuntu-22.04-desktop-amd64/ directory.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (68)

Unmount the Ubuntu Desktop 22.04 LTS ISO image from the /mnt directory as follows:

$ sudo umount /mnt

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (69)

You can also remove the Ubuntu Desktop 22.04 LTS ISO image ubuntu-22.04-desktop-amd64.iso from the PXE boot server if you want.

$ rm -v ~/Downloads/ubuntu-22.04-desktop-amd64.iso

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (70)

Now, create the default iPXE boot configuration file /pxeboot/config/boot.ipxe and open it with the nano text editor as follows:

$ sudo nano /pxeboot/config/boot.ipxe

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (71)

Type in the following lines in the iPXE boot configuration file /pxeboot/config/boot.ipxe:

#!ipxe

set server_ip 192.168.0.130

set root_path /pxeboot

menu Select an OS to boot

item ubuntu-22.04-desktop-amd64 Install Ubuntu Desktop 22.04 LTS

choose --default exit --timeout 10000 option && goto ${option}

:ubuntu-22.04-desktop-amd64

set os_root ubuntu-22.04-desktop-amd64

kernel tftp://${server_ip}/${os_root}/casper/vmlinuz

initrd tftp://${server_ip}/${os_root}/casper/initrd

imgargs vmlinuz initrd=initrd boot=casper maybe-ubiquity netboot=nfs ip=dhcp nfsroot=${server_ip}:${root_path}/${os_root} quiet splash ---

boot

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the iPXE boot configuration file /pxeboot/config/boot.ipxe.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (72)

Here, server_ip is the IP address of the Ubuntu 22.04 LTS PXE boot server¹, and root_path is the NFS share path².

ubuntu-22.04-desktop-amd64 is the label for the boot menu entry Install Ubuntu Desktop 22.04 LTS, and the boot codes for PXE booting Ubuntu Desktop 22.04 LTS are also labeled with the same name³.

os_root is the name of the subdirectory in the /pxeboot/os-images/ directory where you’ve copied the contents of the Ubuntu Desktop 22.04 LTS ISO image⁴.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (73)

PXE Booting Ubuntu Desktop 22.04 LTS Live Installer

Now, boot any computer on the network via PXE, and you should see that the iPXE firmware is being used for the PXE boot process.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (74)

Once the iPXE firmware is initialized, you should see the following boot menu.

Select Install Ubuntu Desktop 22.04 LTS and press <Enter>.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (75)

You should see that iPXE is downloading the vmlinuz and initrd files from the PXE boot server.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (76)

Ubuntu Desktop 22.04 LTS installer is being booted…

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (77)

Once Ubuntu Desktop 22.04 LTS installer is booted, you should see the following window. You can install Ubuntu Desktop 22.04 LTS on your computer as usual from here. If you need any assistance in installing Ubuntu Desktop 22.04 LTS on your computer, read the article Installing Ubuntu Desktop 20.04 LTS. Although the article is for Ubuntu Desktop 20.04 LTS, it may still be helpful.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (78)

If you want to try out Ubuntu Desktop 22.04 LTS in Live mode, click on Try Ubuntu.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (79)

Ubuntu Desktop 22.04 LTS should be PXE booted in live mode.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (80)

Configuring iPXE to PXE Boot Other Linux Distributions

In the same way, you can configure iPXE and the PXE boot server to boot other Linux distributions. Just create a new directory for your desired Linux distribution in the /pxeboot/os-images/ directory and copy the required files from the ISO image of your desired Linux distribution in the newly-created directory. Then, add a new menu entry and boot code for your desired Linux distribution in the iPXE boot configuration file /pxeboot/config/boot.ipxe.

Adding a new menu entry and boot code in the iPXE boot configuration file /pxeboot/config/boot.ipxe is really easy.

Just open the iPXE boot configuration file /pxeboot/config/boot.ipxe with the nano text editor as follows:

$ sudo nano /pxeboot/config/boot.ipxe

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (81)

Then, add a new menu entry and the required boot code, as shown in the screenshot below.

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the /pxeboot/config/boot.ipxe file.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (82)

Now, if you PXE boot other computers on the network, you will see a new menu entry for your desired Linux distribution, and you should be able to boot from it.

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (83)

If you need any assistance in configuring iPXE to PXE boot the following Linux distributions, make sure to read the article How to Configure Synology NAS as PXE Boot Server for Netbooting Linux Installation Images with iPXE (BIOS and UEFI version) at LinuxHint.com.

  • Ubuntu Desktop 20.04 LTS
  • Ubuntu Server 20.04 LTS
  • Ubuntu Server 22.04 LTS
  • Fedora Workstation 36

Conclusion

In this article, I have shown you how to configure Ubuntu 22.04 LTS as a PXE boot server with iPXE. I have also shown you how to configure the PXE boot server to PXE boot Ubuntu Desktop 22.04 LTS installer in Live mode so that you can install it on your computer without needing a CD/DVD drive or USB thumb drive.

References

  1. Netplan | Backend-agnostic network configuration in YAML
  2. Chapter 36. Manually configuring the /etc/resolv.conf file Red Hat Enterprise Linux 8 | Red Hat Customer Portal
  3. networking – Trouble with DnsMasq, DHCP proxy, PXE for UEFI clients – Server Fault
  4. dnsmasq.conf.pxe.uefi · GitHub

About the author

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (84)

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.

View all posts

Configuring PXE Network Boot Server on Ubuntu 22.04 LTS (2024)

FAQs

How do I run a PXE server on Ubuntu? ›

Brief steps involved to configure PXE Boot Server with cloud-init
  1. Download Ubuntu Image (We will use ubuntu-20.04.3-live-server-amd64.iso)
  2. Install and Configure TFTP.
  3. Install and Configure DHCP.
  4. Install and Configure HTTP.
  5. Prepare cloud-init file.
  6. Perform PXE Boot.

How do I know if PXE boot is working Linux? ›

Validate your NFS configuration by doing one or both of the following:
  1. On the PXE server, run the showmount -e command.
  2. On another machine (not the PXE server), run the showmount -e PXE-server command, where PXE-server is the name or IP address of the PXE server. Ensure that the output includes the tftp path:

How do I create a PXE boot server? ›

  1. Step 1: Install and configure DNSMASQ Server. ...
  2. Step 2: Install SYSLINUX Bootloaders. ...
  3. Step 3: Install TFTP-Server and Populate it with SYSLINUX Bootloaders. ...
  4. Step 4: Setup PXE Server Configuration File. ...
  5. Step 5: Add CentOS 7 Boot Images to PXE Server. ...
  6. Step 6: Create CentOS 7 Local Mirror Installation Source.
Oct 16, 2014

Do you need DHCP to PXE boot? ›

PXE Boot Basics. Booting from the network using the PXE protocol involves a simple series of DHCP packets. There are three parties involved: the DHCP server, the PXE server, and the client.

How do I install a network on Ubuntu? ›

Let's begin.
  1. Step 1: Install and Configure Dnsmasq. ...
  2. Step 2: Enable TFTP Server and Download Ubuntu Netboot files. ...
  3. Step 3: Configure the DHCP Server to send the name of the boot image. ...
  4. Step 4: Power on Client and Test.
Dec 23, 2019

What is PXE network boot? ›

The Preboot Execution Environment or PXE (commonly pronounced as pixie) is a client-server environment that enables network computers to boot over the network interface card (NIC), instead of from a CD-ROM or hard disk.

Why is PXE boot not working? ›

If there are difficulties in getting the PXE service to work from the beginning, check that Windows Deployment Services (WDS) is installed and that it is correctly configured for the environment. If the DHCP server is on the same server as WDS, make sure that DHCP option 60 is enabled.

How do I enable PXE boot? ›

Steps to enable PXE boot in BIOS.
...
Environment
  1. Press F2 during boot to enter BIOS setup.
  2. Go to Advanced Settings > Boot Menu.
  3. Select Boot Configuration and uncheck Boot Network Devices Last.
  4. From the Boot Configuration menu, go to Network Boot and enable UEFI PCE & iSCSI.
  5. Select either Ethernet1 Boot or Ethernet2 Boot.

How do I troubleshoot a PXE boot? ›

To do it, follow these steps:
  1. On the DP, clear the Enable PXE checkbox. ...
  2. Verify that PXE was uninstalled. ...
  3. In Server Manager, verify that WDS is uninstalled. ...
  4. Restart the server.
  5. Locate and delete the RemoteInstall folder.
  6. Change the date on the self-signed certificate in the properties of PXE DP.
Jan 25, 2022

What services are required for PXE boot? ›

The PXE boot process

You must make sure that the DHCP (67 and 68), TFTP (69) and BINL (4011) ports are open between the client computer, the DHCP server and the PXE enabled DP. In the PXE boot process, the client must first acquire TCP/IP parameters and the location of the TFTP boot server.

What DHCP options are needed for PXE boot? ›

DHCP Option 60

If you know these details, you can perfectly make the economy of a PXE Service. Just fill these dhcp options (66 and 67) with the needed data. For instance, if your TFTP server runs on the host with IP address 192.168.

Can you PXE boot over Internet? ›

PXE supports both "Legacy" and "uEFI" boots. If you can find a Legacy or uEFI bootable image on the internet that's configured to load and run strictly is memory, it should be possible for PXE to load that just like it loads Clonezilla in our lab.

How do I install a network boot service? ›

Press F2 continuously when you power up your machine until it enters its BIOS Setup. Navigate to the Boot menu. Enable Boot to Network. Press F10 to save changes and exit the BIOS setup.

How do I find a PXE server on my network? ›

boot any machine to PXE. Watch the logs. You will see the responding server's name in the list of ips that come up.

Can I install Ubuntu directly from Internet? ›

Ubuntu can be installed over a network or the Internet. Local Network - Booting the installer from a local server, using DHCP, TFTP, and PXE.

How do I install a network on Linux? ›

To Install the Linux Operating System From a PXE Server
  1. Power cycle the workstation.
  2. Hold down the F8 key until you see the BBS Popup menu. ...
  3. Select a Network: IBA GE Slot entry and press Enter. ...
  4. When prompted, press F12 for a network service boot. ...
  5. Select the image that you want to install.

Can I install Ubuntu without USB? ›

The graphical installation of Ubuntu is effortless and straightforward, just like installing any other well-maintained operating system. In addition, Ubuntu provides ISO Image to install it on any system, and we can either burn it on a CD Drive or a USB Drive to make it a bootable device and install Ubuntu using it.

What is the benefit of a PXE boot? ›

Some of the key advantages of PXE are: The client machine or workstation does not require a storage device or operating system. Network extension and the addition of new client computers is made easier because PXE is vendor-independent. Maintenance is simplified because most tasks are performed remotely.

How does PXE boot work Linux? ›

PXE TFTP Steps

NIC firmware makes a TFTP request to the server using the IP or name specified in the next-server option of the DHCP lease. TFTP server sends the requested file in a udp data stream. NIC firmware receives the file storing it in memory. Server then executes the downloaded file.

How do I start PXE over IPv4? ›

PXE booting is when your system starts over the IPv4-based network.
...
Use the following steps to disable both Legacy Support and Secure Boot.
  1. Startup your PC in BIOS.
  2. Click on the Security tab with your arrow key.
  3. Pick Secure Boot. Click on disable.
  4. Now go to Legacy Support. Disable it.
  5. Save the new settings.
  6. Exit BIOS.
Sep 28, 2021

How do you fix PXE boot abortion? ›

5 Answers
  1. Triple-checked Boundary groups. ...
  2. deleted DHCP scope options especially on the VLAN where the SCCM Server is hosted. ...
  3. Uninstalled ADK.
  4. Reinstalled ADK.
  5. Re-created Boot images (x86 and x64)
  6. Uninstalled PXE and rebooted.
  7. Uninstalled WDS Service and rebooted.
  8. Removed Distribution Point.
Nov 19, 2021

Does PXE boot work with UEFI? ›

When the server is configured for UEFI Boot Mode, PXE servers must be configured with a UEFI boot image. For x64 EFI machines, the DHCP server also needs to be configured to support x64 EFI DHCP boot requests.

What is PXE device enable? ›

Enabling a PXE device and using it for booting. Preboot eXecution Environment (PXE) provides a mechanism for starting a computer through network interfaces. Once a PXE device is enabled in the BIOS of the computer, PXE can be used to boot the system.

What is PXE server Linux? ›

PXE Server – Preboot eXecution Environment is a standardized client-server architecture that instructs a client system to boot, run, or install multiple Linux operating systems using a PXE-capable network interface on your network infrastructure.

How does PXE boot work Linux? ›

PXE TFTP Steps

NIC firmware makes a TFTP request to the server using the IP or name specified in the next-server option of the DHCP lease. TFTP server sends the requested file in a udp data stream. NIC firmware receives the file storing it in memory. Server then executes the downloaded file.

What is PXE in Linux? ›

PXE Server – Preboot eXecution Environment is a standardized client-server architecture that instructs a client system to boot, run, or install multiple Linux operating systems using a PXE-capable network interface on your network infrastructure.

How do I check my boot partition? ›

To do so, follow these steps: Open Disk Management from Control Panel (System and Security > Administrative Tools > Computer Management) At the Status column, the boot partitions are identified using the (Boot) word, while the system partitions are with the (System) word.

How do you tell which drive you booted from Linux? ›

(Even if you are using LVM or RAID you will probably have a /boot partition which can tell you this). Alternatively "hdparm -a /dev/sdX" will tell you the model AND SERIAL number of the drive, so you could run this command and grep to work out which hard drive is which.

Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6703

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.