Synology

How To Configure Synology NAS to PXE Boot Linux Installation Images With iPXE (BIOS and UEFI versions)

iPXE is a modern PXE firmware that works for the BIOS and UEFI motherboards. It can download the required boot files using many protocols, such as TFTP, FTP, HTTP, HTTPS, and NFS. Also, iPXE can boot from iSCSI SAN (Storage Area Network), Fibre Channel SAN via FCoE, and AoE SAN. iPXE can boot operating system installer images and full operating systems without requiring any HDD/SSD installed on the host (iSCSI SAN boot). Diskless booting with iPXE is very easy to configure.In addition, iPXE supports scripting. You can control the boot process with iPXE scripts stored on a remote server. Thus, iPXE script is a very powerful tool for dynamic boot management with iPXE.

For more information on iPXE, visit the official website of iPXE.

This article will show you how to compile iPXE and configure your Synology NAS as a PXE Boot server for booting Linux installation images over the network via iPXE. As iPXE supports BIOS and UEFI motherboards, I will show you how to configure the iPXE Boot server on your Synology NAS for PXE booting on BIOS and UEFI motherboards.

Plus, I will demonstrate how to configure the iPXE Boot server for booting the installation images of the following Linux distributions:

Now, let’s get started.

Table of Contents

  1. Creating a pxeboot Shared Folder
  2. Enabling Access to the NAS Files via HTTP/HTTPS
  3. Enabling NFS for the web Shared Folder
  4. Enabling the TFTP Service
  5. Installing DHCP Server
  6. Enabling DHCP for a Network Interface
  7. Booting Ubuntu Installer in Live Mode
  8. Installing Required Dependencies for Building iPXE on Ubuntu Desktop Live
  9. Cloning iPXE Git Repository
  10. Enabling iPXE NFS, HTTPS, and FTP Protocol Support
  11. Creating an iPXE Embedded Boot Configuration File
  12. Compiling iPXE for BIOS-Based Motherboards
  13. Compiling iPXE for UEFI-Based Motherboards
  14. Uploading the Required Files to the NAS
  15. Creating Default iPXE Boot Configuration File
  16. Enabling PXE on Synology NAS
  17. Basics of iPXE Boot Configuration File
  18. PXE Booting Ubuntu Desktop 20.04 LTS Live With iPXE
  19. PXE Booting Ubuntu Server 20.04 LTS With iPXE
  20. PXE Booting Ubuntu Desktop 22.04 LTS Live With iPXE
  21. PXE Booting Ubuntu Server 22.04 LTS With iPXE
  22. PXE Booting Fedora 36 Workstation Live With iPXE
  23. Conclusion
  24. References

Creating a pxeboot Shared Folder

To keep all the iPXE Boot files organized, you should create a new shared folder, pxeboot, as shown in the screenshot below.

If you need any assistance in creating a new shared folder, read How to Setup Synology NAS?

Enabling Access to the NAS Files via HTTP/HTTPS

iPXE can download the required boot files and iPXE configuration files (a.k.a iPXE scripts) from a web server using the HTTP/HTTPS protocol.

NOTE: iPXE HTTPS support is not enabled by default. You will have to enable it manually before compiling iPXE. Check Enabling iPXE NFS, HTTPS, and FTP Protocol Support for more information.

To set up a web server on your Synology NAS, you will have to install the Web Station package on your Synology NAS from the Package Center app. Once you install the Web Station package, you will be able to access the iPXE configuration files (iPXE scripts) and required operating system kernels (and boot files) from your Synology NAS via HTTP/HTTPS.

To install Web Station on your Synology NAS, open the Package Center app, search for Web Station, and click on the Web Station package.

Click on Install.

The Web Station package should be installed.

Once Web Station is installed, A new shared folder web should be automatically created, as shown in the screenshot below. You can access any files stored in this shared folder via HTTP/HTTPS.

Enabling NFS for the web Shared Folder

You will also need to enable the NFS file service and configure the web shared folder for NFS access for PXE booting to work for some Linux distributions (i.e., Ubuntu).

To enable the NFS file service, navigate to Control Panel > File Services.

From the NFS tab, check the Enable NFS service checkbox, as marked in the following screenshot:

Click on Apply for the changes to take effect.

The NFS file service should be enabled.

Now, navigate to Control Panel > Shared Folder, select the web shared folder, and click on Edit as marked in the following screenshot:

Click on Create from the NFS Permissions tab.

Type in * in the Hostname or IP section1, check the Allow connections from non-privileged ports (ports higher than 1024) checkbox2, check the Allow users to access mounted subfolders checkbox3, and click on Save4.

A new NFS access rule should be created1.

The shared folder can be accessed using the path /volume1/web, as shown in the screenshot below2. Remember the shared folder path as you will need it later.

For the changes to take effect, click on Save3.

Enabling the TFTP Service

To serve the iPXE Boot firmware and configuration files (iPXE scripts) to the PXE clients, you must enable the TFTP file service on your Synology NAS.

To enable the TFTP file service, navigate to Control Panel > File Services.

From the Advanced tab, scroll down to the TFTP section and check the Enable TFTP service checkbox, as marked in the following screenshot:

Click on Select as marked in the following screenshot to set a TFTP root folder:

All the shared folders of your Synology NAS should be listed. Select the pxeboot shared folder and click on Select.

Click on Apply for the changes to take effect.

The TFTP file service should be enabled, and the TFTP root folder should be set.

Installing DHCP Server

For PXE booting to work, you will need a working DHCP server.

To install a DHCP server on your Synology NAS, open the Package Center app1, search for the keyword dhcp2, and click on the DHCP Server package, as marked in the following screenshot3:

Click on Install.

The DHCP Server package should be installed.

Once the DHCP Server package is installed, you can start it from the Application Menu of the DSM web interface of your Synology NAS.

The DHCP Server app should be opened. You can configure the DHCP server and enable PXE booting with iPXE from here.

Enabling DHCP for a Network Interface

To enable DHCP, open the DHCP Server app, select a network interface from the Network Interface section, and click Edit, as marked in the following screenshot:

Check the Enable DHCP server checkbox from the DHCP Server tab, as marked in the following screenshot:

Type in your desired Primary DNS and Secondary DNS servers. I am using 8.8.8.8 as the Primary DNS and 1.1.1.1 as the Secondary DNS server1.

From the Subnet list section, click on Create2.

You will be asked to create a DHCP subnet.

Usually, your home router will have a DHCP server running. You can’t turn it off as you need it for your home network devices (i.e., laptops, desktops, smartphones, and IoT devices). To get a working DHCP server on your Synology NAS without turning off the DHCP server of your home router, you will have to create the same DHCP subnet on your Synology NAS as your home router. You will have two DHCP servers, but the one configured on your Synology NAS will supply the required files for PXE booting. No matter which DHCP server your home-networking devices use, everything will work fine as they will be on the same subnet.

Type in your desired Start IP address1, End IP address2, Netmask3, and Gateway4, depending on the subnet of your home router.

My home router is using the subnet 192.168.0.0/24, and its IP address is 192.168.0.1. So, I have used the Gateway address 192.168.0.1 and Netmask 255.255.255.0. The Start and End IP addresses can be anything within the subnet. I have used the Start IP address 192.168.0.200 and the End IP address 192.168.0.230 in this case.

Type in 3600 (an hour) as the Address lease time5. It is the time the DHCP server will reserve an IP address for a DHCP client.

Once you’re done, click on Create6.

A new subnet should be created, as shown in the following screenshot:

Check the Enabled checkbox to enable the subnet and click on OK, as marked in the following screenshot:

Click on Yes.

DHCP should be enabled for your selected network interface.

Booting Ubuntu Installer in Live Mode

To compile iPXE from source code, you will need a Linux computer. I recommend you create a bootable USB thumb drive using the official Ubuntu Desktop 22.04 LTS ISO image and boot Ubuntu Desktop 22.04 LTS on your computer in Live mode from the USB thumb drive. If you need any assistance in creating a Ubuntu Desktop bootable USB thumb drive, check the article Installing Ubuntu Desktop 20.04 LTS.

Installing Required Dependencies for Building iPXE on Ubuntu Desktop Live

Once you’ve booted Ubuntu Desktop 22.04 LTS in Live mode on your computer, you will have to install all the required build tools and dependency packages for compiling iPXE.

Some of the dependency packages are available in the official universe repository of Ubuntu. So, you will have to enable the official universe package repository with the following command:

$ sudo apt-add-repository universe

To confirm the action, press .

The official universe package repository should be enabled, and the APT package repository cache should start updating. It will take a few seconds to complete.

At this point, the APT package repository cache should be updated.

To install all the required build tools and dependency packages for compiling iPXE, run the following command:

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

To confirm the installation, press Y and then press .

The required packages are being downloaded from the internet. It will take a while to complete.

Once downloaded, the APT package manager will install them one by one. It could take a while to complete.

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

Cloning iPXE Git Repository

Now that your Ubuntu Desktop Live is ready to compile iPXE, it’s time to download the iPXE source code.

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

$ cd ~/Downloads

To clone the iPXE code repository from GitHub, run the following command:

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

The iPXE GitHub repository is being cloned. It could take a few seconds to complete.

At this point, the iPXE GitHub repository should be cloned.

A new directory ipxe/ should be created in the ~/Downloads directory, as shown in the following screenshot:

$ ls -lh

Navigate to the ipxe/src/ directory as follows:

$ cd ipxe/src

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

$ ls -lh

Enabling iPXE NFS, HTTPS, and FTP Protocol Support

iPXE can download iPXE Boot configuration files (iPXE scripts) and operating system kernels using many protocols, such as HTTP, HTTPS, TFTP, FTP, and NFS. But not all of these protocols (i.e., HTTPS, FTP, and NFS) are enabled by default. But, if needed, you can modify the ipxe/src/config/general.h header file to allow any of these protocols.

You can open the config/general.h header file with the nano text editor as follows:

$ nano config/general.h

Scroll down to the Download protocols section1, and you should see some lines with the text DOWNLOAD_PROTO_*.

The DOWNLOAD_PROTO_* line starting with #define enables the respective download protocol. In the same way, the DOWNLOAD_PROTO_* line starting with #undef disables the respective download protocol.

To enable the HTTPS protocol, change #undef to #define for DOWNLOAD_PROTO_HTTPS2.

To enable the FTP protocol, change #undef to #define for DOWNLOAD_PROTO_FTP3.

To enable the NFS protocol, change #undef to #define for DOWNLOAD_PROTO_NFS4.

I have enabled the NFS protocol for demonstration, as you can see in the following screenshot.

Once you’ve enabled the required download protocols, press + X followed by Y and to save the general.h header file.

Creating an iPXE Embedded Boot Configuration File

To configure iPXE to automatically boot from an iPXE Boot script stored on your Synology NAS, you 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

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

#!ipxe

dhcp

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

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

NOTE: Here, 192.168.0.114 is the IP address of my Synology NAS. Don’t forget to replace it with yours. If you need any assistance in finding the IP address of your Synology NAS, read the article How Do I Find the IP Address of My Synology NAS?

Now, you’re ready to compile iPXE.

Compiling iPXE for BIOS-Based Motherboards

For BIOS-based motherboards, iPXE provides a few iPXE firmware files for PXE booting. They are: ipxe.pxe, undionly.kpxe, undionly.kkpxe, undionly.kkkpxe, etc.

Not all of these iPXE firmware work on every BIOS-based motherboard. If you’re using a BIOS-based motherboard, you can try each one and see which one works for you. I recommend you start with ipxe.pxe firmware. If it does not work, try the undionly.kpxe firmware. If that also does not work, then try the undionly.kkpxe firmware. Finally, if that does not work either, try the undionly.kkkpxe firmware.

You can compile the ipxe.pxe firmware and embed the bootconfig.ipxe iPXE script with the following command:

$ make bin/ipxe.pxe EMBED=bootconfig.ipxe

The ipxe.pxe firmware file is being compiled. It could take a few seconds to complete.

The ipxe.pxe firmware should be compiled at this point.

You can compile the undionly.kpxe firmware and embed the bootconfig.ipxe iPXE script with the following command:

$ make bin/undionly.kpxe EMBED=bootconfig.ipxe

The undionly.kpxe firmware should be compiled.

You can compile the undionly.kkpxe firmware and embed the bootconfig.ipxe iPXE script with the following command:

$ make bin/undionly.kkpxe EMBED=bootconfig.ipxe

The undionly.kkpxe firmware should be compiled.

You can compile the undionly.kkkpxe firmware and embed the bootconfig.ipxe iPXE script with the following command:

$ make bin/undionly.kkkpxe EMBED=bootconfig.ipxe

The undionly.kkkpxe firmware should be compiled.

You can find all the compiled iPXE firmware files for BIOS-based motherboards in the bin/ directory as shown in the following screenshot:

$ ls -lh bin/{ipxe.pxe,undionly.kpxe,undionly.kkpxe,undionly.kkkpxe}
[/c]

c
<img class="wp-image-187071" src="https://linuxhint.com/wp-content/uploads/2022/06/word-image-186659-66.png" />
<h2><a id="post-186659-_Toc103306321"></a>Compiling iPXE for UEFI-Based Motherboards</h2>
For UEFI-based motherboards, you will need to compile only the iPXE firmware file <strong>ipxe.efi</strong> for PXE booting.

You can compile the <strong>ipxe.efi</strong> firmware and embed the <strong>bootconfig.ipxe</strong> iPXE script with the following command:
[cc lang="bash" width="100%" height="100%" escaped="true" theme="blackboard" nowrap="0"]
$ make bin-x86_64-efi/ipxe.efi EMBED=bootconfig.ipxe

The ipxe.efi firmware file is being compiled. It could take a few seconds to complete.

The ipxe.efi firmware file is being compiled.

The ipxe.efi firmware should be compiled at this point.

You can find the compiled iPXE firmware file for UEFI-based motherboards in the bin-x86_64-efi/ directory, as you can see in the following screenshot:

$ ls -lh bin-x86_64-efi/ipxe.efi

Uploading the Required Files to the NAS

Once the iPXE Boot firmware files are compiled, copy them to the ~/Downloads directory so that you can easily upload them to your Synology NAS.

$ cp -v bin/{ipxe.pxe,undionly.kpxe,undionly.kkpxe,undionly.kkkpxe} bin-x86_64-efi/ipxe.efi ~/Downloads

The iPXE Boot firmware files (ipxe.pxe, undionly.kpxe, undionly.kkpxe, undionly.kkkpxe, and ipxe.efi) are copied to the ~/Downloads directory, as shown in the following screenshot:

Drag and drop all the iPXE Boot firmware files in the pxeboot shared folder of your Synology NAS.

Creating Default iPXE Boot Configuration File

I have compiled iPXE in a way (using the bootconfig.ipxe embedded iPXE script) that once the iPXE Boot firmware is loaded on a PXE client, it will look for the iPXE boot configuration file boot.ipxe in the config/ directory of the pxeboot shared folder of your Synology NAS.

To create a config/ folder on the pxeboot shared folder, navigate to the pxeboot shared folder using the File Station app and click on Create > Create folder as marked in the following screenshot:

Type in config as the folder name and click on OK.

A new folder config should be created.

Create/Upload a new iPXE Boot configuration file (iPXE script) boot.ipxe here and type in the following lines in it.

If iPXE Boot firmware successfully loads on a PXE client and it downloads and runs the iPXE script boot.ipxe, you will see the message Welcome to iPXE on the screen. This will help you ensure the iPXE is working as expected.

Enabling PXE on Synology NAS

Once you have created the default iPXE Boot configuration file (iPXE script) config/boot.ipxe, you can enable PXE booting on your Synology NAS.

Open the DHCP Server app, navigate to the PXE section, and check the Enable PXE (Pre-boot Execution Environment) checkbox, as marked in the following screenshot:

Once PXE is enabled, select Local TFTP server, and click on Select.

All the iPXE Boot firmware files uploaded in the pxeboot shared folder should be listed.

For BIOS-based motherboards, you can select any of the iPXE Boot firmware files ipxe.pxe, undionly.kpxe, undionly.kkpxe, and undionly.kkkpxe. I recommend you select the ipxe.pxe firmware file first. If that does not work, try the undionly.kpxe firmware file. If that also doesn’t work, try the undionly.kkpxe firmware file. Finally, try the undionly.kkkpxe firmware file.

For UEFI-based motherboards, select the iPXE Boot firmware file ipxe.efi and click on Select.

Once you’ve selected an iPXE Boot firmware, click on Apply.

PXE should be enabled, and your desired iPXE Boot firmware should be set as the PXE Boot loader.

Now, if you boot your computer via PXE, you should see the following iPXE window and the message Welcome to iPXE. It means that the PXE booting with the iPXE Boot firmware is working just fine.

Basics of iPXE Boot Configuration File

This section will show you how to write a basic iPXE Boot configuration file or iPXE script to boot multiple operating system installation images over the network with iPXE.

An example of an iPXE Boot configuration file (or iPXE script) config/boot.ipxe (on your pxeboot shared folder) with multiple boot menu entries should look as follows:

Here, lines 3 and 4 are used to set two configuration settings: http_server_ip and nfs_server_ip. These two configuration settings set the webserver IP address (http_server_ip) and NFS server IP address (nfs_server_ip). You should set them to the IP address of your Synology NAS. If you need any assistance in finding the IP address of your Synology NAS, read the article How Do I Find the IP Address of My Synology NAS?

NOTE: Configuration settings are like variables in iPXE scripts. For more information on the set command, visit the official documentation of iPXE.

Line 5 is used to set the configuration setting nfs_root_path. Then, the nfs_root_path is used to set the NFS path of the web shared folder of your Synology NAS. To find the NFS path of the web shared folder, check this article’s Enabling NFS for the web Shared Folder section.

Lines 7–13 are used to create an iPXE boot menu. Lines starting with the item command are used to create boot menu entries. You can have as many boot menu entries as you want in an iPXE boot menu.

In this example, I have three boot menu entries (lines 9, 10, and 11):

The item command is used to create a boot menu entry in the following format:

item <label> <display-text>

<display-text> is the text to be displayed in the iPXE boot menu.

<label> is the name/label of the code section where iPXE will jump to when the menu item/entry is selected.

For more information on the item command, visit the official iPXE documentation.

For example, line 9 displays the text Operating System 1 on the iPXE boot menu. When this boot menu entry is selected, it will jump to the code section os1.

You can define a named/labeled code section os1 (let’s say) for the menu item Operating System 1 as follows:

Once you select a menu item, it will execute only the named/labeled section of code defined in that menu item.

So, the menu entry Operating System 1 will execute the code section named/labeled os1 once selected.

The same goes for the Operating System 2 menu entry.

And the Operating System 3 menu entry.

For a working iPXE boot menu configuration, look at the Booting Ubuntu Desktop 20.04 LTS Live via iPXE section.

 

PXE Booting Ubuntu Desktop 20.04 LTS Live With iPXE

First, download the Ubuntu Desktop 20.04 LTS ISO image from the official release page of Ubuntu 20.04 LTS.

Once the Ubuntu Desktop 20.04 LTS ISO image is downloaded, upload it to the web shared folder of your Synology NAS.

Right-click on the Ubuntu Desktop 20.04 LTS ISO image and click on Mount Virtual Drive, as marked in the following screenshot:

Make sure that the ISO image is mounted in the web shared folder1. Also, ensure to check the Mount automatically on startup checkbox so that the ISO image will be mounted automatically when your Synology NAS boots2. Then, click on Mount to mount the ISO image3.

The ISO image of Ubuntu Desktop 20.04 LTS should be mounted in the web shared folder, as you can see in the following screenshot:

NOTE: Remember the folder name where Ubuntu Desktop 20.04 LTS ISO image is mounted, as you will need it later to set the os_root configuration settings in the config/boot.ipxe file. In this case, ubuntu-20.04.4-desktop-amd64 is the mounted folder name.

The contents of the mounted Ubuntu Desktop 20.04 LTS ISO image.

To PXE boot Ubuntu Desktop 20.04 LTS using the iPXE Boot firmware, you will have to add a menu entry for Ubuntu Desktop 20.04 LTS and the required boot code on the config/boot.ipxe configuration file that you have created in the pxeboot shared folder.

Type in the following lines in the config/boot.ipxe configuration file to PXE boot Ubuntu Desktop 20.04 LTS using the iPXE Boot firmware:

#!ipxe

set http_server_ip 192.168.0.114

set nfs_server_ip 192.168.0.114

set nfs_root_path /volume1/web

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

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

:ubuntu-desktop-2004-nfs

set os_root ubuntu-20.04.4-desktop-amd64

kernel nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/vmlinuz

initrd nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/initrd

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

boot

Once you’ve added a menu entry for Ubuntu Desktop 20.04 LTS and the required boot code, the config/boot.ipxe iPXE boot configuration file should look as follows:

Set the os_root configuration setting to the folder’s name where the Ubuntu Desktop 20.04 LTS ISO image is mounted.

Now, boot your computer via PXE, and you should see the following iPXE boot menu.

Select Ubuntu Desktop 20.04 LTS (NFS) and press <Enter>.

You should see that the vmlinuz and initrd files are downloaded from the PXE Boot server running on your Synology NAS.

Ubuntu Desktop 20.04 LTS Live is being booted.

Ubuntu Desktop 20.04 LTS Live is being booted.

Once Ubuntu Desktop 20.04 LTS Live is booted, you should see the following window. You can install Ubuntu Desktop 20.04 LTS on your computer from here. If you need any assistance in installing Ubuntu Desktop 20.04 LTS on your computer, read the article Installing Ubuntu Desktop 20.04 LTS.

Ubuntu Desktop 20.04 LTS PXE booted in live mode using the iPXE Boot firmware.

PXE Booting Ubuntu Server 20.04 LTS With iPXE

First, download the Ubuntu Server 20.04 LTS ISO image from the official release page of Ubuntu 20.04 LTS.

Once the Ubuntu Server 20.04 LTS ISO image is downloaded, upload it to the web shared folder of your Synology NAS.

Right-click on the Ubuntu Server 20.04 LTS ISO image and click on Mount Virtual Drive, as marked in the following screenshot:

Make sure that the ISO image is mounted in the web shared folder1. Also, ensure to check the Mount automatically on startup checkbox so that the ISO image will be mounted automatically when your Synology NAS boots2. Then, click on Mount to mount the ISO image3.

The ISO image of Ubuntu Server 20.04 LTS should be mounted in the web shared folder, as shown in the following screenshot:

NOTE: Remember the folder name where Ubuntu Server 20.04 LTS ISO image is mounted as you will need it later to set the os_root configuration settings in the config/boot.ipxe file. In this case, ubuntu-20.04.4-live-server-amd64 is the mounted folder name.

The contents of the mounted Ubuntu Server 20.04 LTS ISO image.

To PXE boot Ubuntu Server 20.04 LTS using the iPXE Boot firmware, you will have to add a menu entry for Ubuntu Server 20.04 LTS on the config/boot.ipxe configuration file that you have created in the pxeboot shared folder.

Add a menu entry for Ubuntu Server 20.04 LTS and type the required boot code in the config/boot.ipxe configuration file to PXE boot Ubuntu Server 20.04 LTS using the iPXE Boot firmware:

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

item ubuntu-server-2004-nfs Ubuntu Server 20.04 LTS (NFS)

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

:ubuntu-server-2004-nfs

set os_root ubuntu-20.04.4-live-server-amd64

kernel nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/vmlinuz

initrd nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/initrd

imgargs vmlinuz initrd=initrd netboot=nfs ip=dhcp nfsroot=${nfs_server_ip}:${nfs_root_path}/${os_root} quiet ---

boot

Once you’ve added a menu entry for Ubuntu Server 20.04 LTS and typed in the required boot code, the config/boot.ipxe iPXE Boot configuration file should look as follows:

Make sure to set the os_root configuration setting to the folder’s name where the Ubuntu Server 20.04 LTS ISO image is mounted.

Now, boot your computer via PXE and you should see the following iPXE boot menu.

Select Ubuntu Server 20.04 LTS (NFS) and press <Enter>.

You should see that the vmlinuz and initrd files are downloaded from the PXE Boot server running on your Synology NAS.

Ubuntu Server 20.04 LTS is being booted.

Once Ubuntu Server 20.04 LTS is booted, you should see the following window. You can install Ubuntu Server 20.04 LTS on your computer/server from here. If you need assistance installing Ubuntu Server 20.04 LTS on your computer/server, read the article Installing Ubuntu Server 20.04 LTS.

PXE Booting Ubuntu Desktop 22.04 LTS Live With iPXE

First, download the Ubuntu Desktop 22.04 LTS ISO image from the official release page of Ubuntu 22.04 LTS.

Once the Ubuntu Desktop 22.04 LTS ISO image is downloaded, upload it to the web shared folder of your Synology NAS.

Right-click on the Ubuntu Desktop 22.04 LTS ISO image and click on Mount Virtual Drive, as marked in the following screenshot:

Make sure that the ISO image is mounted in the web shared folder1. Also, ensure to check the Mount automatically on startup checkbox so that the ISO image will be mounted automatically when your Synology NAS boots2. Then, click on Mount to mount the ISO image3.

The ISO image of Ubuntu Desktop 22.04 LTS should be mounted in the web shared folder as shown in the following screenshot:

NOTE: Remember the folder name where the Ubuntu Desktop 22.04 LTS ISO image is mounted as you will need it later to set the os_root configuration settings in the config/boot.ipxe file. In this case, ubuntu-22.04-desktop-amd64 is the mounted folder name.

The contents of the mounted Ubuntu Desktop 22.04 LTS ISO image.

To PXE boot Ubuntu Desktop 22.04 LTS using the iPXE Boot firmware, you will have to add a menu entry for Ubuntu Desktop 22.04 LTS on the config/boot.ipxe configuration file that you have created in the pxeboot shared folder.

Add a menu entry for Ubuntu Desktop 22.04 LTS and type in the required boot code in the config/boot.ipxe configuration file to PXE boot Ubuntu Desktop 22.04 LTS using the iPXE Boot firmware:

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

item ubuntu-server-2004-nfs Ubuntu Server 20.04 LTS (NFS)

item ubuntu-desktop-2204-nfs Ubuntu Desktop 22.04 LTS (NFS)

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

:ubuntu-desktop-2204-nfs

set os_root ubuntu-22.04-desktop-amd64

kernel nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/vmlinuz

initrd nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/initrd

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

boot

Once you’ve added a menu entry for Ubuntu Desktop 22.04 LTS and typed in the required boot code, the config/boot.ipxe iPXE Boot configuration file should look as follows:

Make sure to set the os_root configuration setting to the folder’s name where the Ubuntu Desktop 22.04 LTS ISO image is mounted.

Now, boot your computer via PXE and you should see the following iPXE boot menu.

Select Ubuntu Desktop 22.04 LTS (NFS) and press <Enter>.

You should see that the vmlinuz and initrd files are being downloaded from the PXE Boot server running on your Synology NAS.

Ubuntu Desktop 22.04 LTS Live is being booted.

Once Ubuntu Desktop 22.04 LTS Live is booted, you should see the following window. You can install Ubuntu Desktop 22.04 LTS on your computer from here. If you need any assistance in installing the 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.

Ubuntu Desktop 22.04 LTS PXE booted in live mode using the iPXE Boot firmware.

PXE Booting Ubuntu Server 22.04 LTS With iPXE

First, download the Ubuntu Server 22.04 LTS ISO image from the official release page of Ubuntu 22.04 LTS.

Once the Ubuntu Server 22.04 LTS ISO image is downloaded, upload it to the web shared folder of your Synology NAS.

Right-click on the Ubuntu Server 22.04 LTS ISO image and click on Mount Virtual Drive, as marked in the following screenshot:

Make sure that the ISO image is mounted in the web shared folder1. Also, ensure to check the Mount automatically on startup checkbox so that the ISO image will be mounted automatically when your Synology NAS boots2. Then, click on Mount to mount the ISO image3.

The ISO image of Ubuntu Server 22.04 LTS should be mounted in the web shared folder as shown in the following screenshot:

NOTE: Remember the folder name where Ubuntu Server 22.04 LTS ISO image is mounted as you will need it later to set the os_root configuration settings in the config/boot.ipxe file. In this case, ubuntu-22.04-live-server-amd64 is the mounted folder name.

The contents of the mounted Ubuntu Server 22.04 LTS ISO image.

To PXE boot Ubuntu Server 22.04 LTS using the iPXE Boot firmware, you will have to add a menu entry for Ubuntu Server 22.04 LTS on the config/boot.ipxe configuration file that you have created in the pxeboot shared folder.

Add a menu entry for Ubuntu Server 22.04 LTS and type in the required boot code in the config/boot.ipxe configuration file to PXE boot Ubuntu Server 22.04 LTS using the iPXE Boot firmware:

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

item ubuntu-server-2004-nfs Ubuntu Server 20.04 LTS (NFS)

item ubuntu-desktop-2204-nfs Ubuntu Desktop 22.04 LTS (NFS)

item ubuntu-server-2204-nfs Ubuntu Server 22.04 LTS (NFS)

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

:ubuntu-server-2204-nfs

set os_root ubuntu-22.04-live-server-amd64

kernel nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/vmlinuz

initrd nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/casper/initrd

imgargs vmlinuz initrd=initrd netboot=nfs ip=dhcp nfsroot=${nfs_server_ip}:${nfs_root_path}/${os_root} quiet ---

boot

Once you’ve added a menu entry for Ubuntu Server 22.04 LTS and typed in the required boot code, the config/boot.ipxe iPXE Boot configuration file should look as follows:

Make sure to set the os_root configuration setting to the folder’s name where the Ubuntu Server 22.04 LTS ISO image is mounted.

Now, boot your computer via PXE and you should see the following iPXE boot menu.

Select Ubuntu Server 22.04 LTS (NFS) and press <Enter>.

You should see that the vmlinuz and initrd files are being downloaded from the PXE Boot server running on your Synology NAS.

Ubuntu Server 22.04 LTS is being booted.

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

PXE Booting Fedora 36 Workstation Live With iPXE

First, download the Fedora Workstation 36 ISO image from the official downloads page of Fedora Workstation.

Once the Fedora Workstation 36 ISO image is downloaded, upload it to the web shared folder of your Synology NAS.

Right-click on the Fedora Workstation 36 ISO image and click on Mount Virtual Drive, as marked in the following screenshot:

Make sure that the ISO image is mounted in the web shared folder1. Also, ensure to check the Mount automatically on startup checkbox so that the ISO image will be mounted automatically when your Synology NAS boots2. Then, click on Mount to mount the ISO image3.

The ISO image of Fedora Workstation 36 Live should be mounted in the web shared folder, as shown in the screenshot below.

NOTE: Remember the folder name where Fedora Workstation 36 Live ISO image is mounted as you will need it later to set the os_root configuration settings in the config/boot.ipxe file. In this case, Fedora-Workstation-Live-x86_64-36-1.5 is the mounted folder name.

The contents of the mounted Fedora Workstation 36 Live ISO image.

To PXE boot Fedora Workstation 36 Live using the iPXE Boot firmware, you will have to add a menu entry for Fedora Workstation 36 Live on the config/boot.ipxe configuration file that you have created in the pxeboot shared folder. Fedora Workstation can be PXE booted using the NFS protocol and the HTTP/HTTPS protocol. This section shows you how to PXE boot Fedora Workstation using the NFS and HTTP protocols.

If you want to PXE boot Fedora Workstation 36 Live with the iPXE Boot firmware using the NFS protocol, add a menu entry for Fedora Workstation 36 Live and type in the required boot code in the config/boot.ipxe configuration file as follows:

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

item ubuntu-server-2004-nfs Ubuntu Server 20.04 LTS (NFS)

item ubuntu-desktop-2204-nfs Ubuntu Desktop 22.04 LTS (NFS)

item ubuntu-server-2204-nfs Ubuntu Server 22.04 LTS (NFS)

item fedora-workstation-36-live-nfs Fedora Workstation 36 Live (NFS)

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

:fedora-workstation-36-live-nfs

set os_root Fedora-Workstation-Live-x86_64-36-1.5

kernel nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/images/pxeboot/vmlinuz

initrd nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/images/pxeboot/initrd.img

imgargs vmlinuz initrd=initrd.img ip=dhcp rd.live.image root=live:nfs://${nfs_server_ip}${nfs_root_path}/${os_root}/LiveOS/squashfs.img

boot

Once you’ve added a menu entry for Fedora Workstation 36 Live and typed in the required boot code for booting Fedora Workstation using the NFS protocol, the config/boot.ipxe iPXE Boot configuration file should look as follows:

If you want to PXE boot Fedora Workstation 36 Live with the iPXE Boot firmware using the HTTP protocol, add a menu entry for Fedora Workstation 36 Live and type in the required boot code in the config/boot.ipxe configuration file as follows:

menu Select an OS to boot

item ubuntu-desktop-2004-nfs Ubuntu Desktop 20.04 LTS (NFS)

item ubuntu-server-2004-nfs Ubuntu Server 20.04 LTS (NFS)

item ubuntu-desktop-2204-nfs Ubuntu Desktop 22.04 LTS (NFS)

item ubuntu-server-2204-nfs Ubuntu Server 22.04 LTS (NFS)

item fedora-workstation-36-live-nfs Fedora Workstation 36 Live (NFS)

item fedora-workstation-36-live-http Fedora Workstation 36 Live (HTTP)

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

:fedora-workstation-36-live-http

set os_root Fedora-Workstation-Live-x86_64-36-1.5

initrd http://${http_server_ip}/${os_root}/images/pxeboot/initrd.img

kernel http://${http_server_ip}/${os_root}/images/pxeboot/vmlinuz initrd=initrd.img ip=dhcp rd.live.image root=live:http://${http_server_ip}/${os_root}/LiveOS/squashfs.img

boot

Once you’ve added a menu entry for Fedora Workstation 36 Live and typed in the required boot code for booting Fedora Workstation using the HTTP protocol, the config/boot.ipxe iPXE Boot configuration file should look as follows:

Make sure to set the os_root configuration setting to the folder’s name where the Fedora Workstation 36 Live ISO image is mounted.

Now, boot your computer via PXE and you should see the following iPXE boot menu.

Select either Fedora Workstation 36 Live (NFS) or Fedora Workstation 36 Live (HTTP) and press <Enter>.

If you have selected Fedora Workstation 36 Live (NFS), you should see that the vmlinuz and initrd.img files are being downloaded from the PXE Boot server running on your Synology NAS using the NFS protocol.

If you have selected Fedora Workstation 36 Live (HTTP), you should see that the vmlinuz and initrd.img files are being downloaded from the PXE Boot server running on your Synology NAS using the HTTP protocol.

Fedora Workstation 36 Live is being booted.

Once Fedora Workstation 36 Live is booted, you should see the following window. You can install Fedora Workstation 36 on your computer from here. If you need any assistance installing Fedora Workstation 36 on your computer, read the article How to Install Fedora Workstation 35 from USB. Although the article was published several months ago, it will still be helpful.

Fedora Workstation 36 PXE booted in live mode using the iPXE Boot firmware.

Fedora Workstation 36 installer once PXE booted using the iPXE Boot firmware.

Conclusion

This article discussed how to configure the TFTP, HTTP (webserver), and NFS file services on your Synology NAS for PXE booting. I have shown you how to compile iPXE (for BIOS and UEFI motherboards) and copy the necessary iPXE Boot firmware files to your Synology NAS. I also provided a guide on how to install and configure the DHCP Server package for PXE booting on BIOS/UEFI systems over the network with iPXE. Finally, I have shown you how to add the necessary iPXE boot menu entries and the required boot codes for PXE booting the following Linux distributions with iPXE:

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

References

  1. https://ipxe.org/download
  2. https://ipxe.org/embed
  3. https://ipxe.org/appnote/buildtargets
  4. https://ipxe.org/cmd/set
  5. https://ipxe.org/cmd/menu
  6. https://ipxe.org/cmd/item
  7. https://ipxe.org/cmd/choose
  8. https://ipxe.org/cmd/kernel
  9. https://ipxe.org/cmd/imgfetch?redirect=1
  10. https://ipxe.org/cmd/imgargs
  11. https://forum.ipxe.org/showthread.php?tid=6989
  12. https://medium.com/@peter.bolch/how-to-netboot-with-ipxe-6a41db514dee
  13. https://medium.com/@peter.bolch/how-to-netboot-with-ipxe-6191ed711348
  14. http://manpages.ubuntu.com/manpages/bionic/man7/casper.7.html
  15. https://anaconda-installer.readthedocs.io/en/latest/boot-options.html

About the author

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.