Synology

How to Configure Synology NAS as PXE Boot Server for Netbooting Linux Installation Images with PXELINUX (BIOS version)

The full form of PXE is Preboot Execution Environment. It is a specialized boot ROM built into many newest generation network cards. It is mainly used to boot an operating system installer over the network and install it on your computer/server. So, you won’t need a CD/DVD ROM or a USB bootable thumb drive to install your favorite operating system on your computer/server.

In this article, I am going to show you how to configure your Synology NAS as a network boot server using PXELINUX and the PXE boot for the installation image of the following Linux distributions over the network on BIOS-based motherboards.

So, let’s get started.

Table of Contents:

  1. Creating a pxeboot Shared Folder
  2. Enabling NFS for the pxeboot Shared Folder
  3. Enabling the TFTP Service
  4. Installing DHCP Server
  5. Enabling DHCP for a Network Interface
  6. Downloading PXELINUX
  7. Uploading the Required Files to the NAS
  8. Creating a PXELINUX default Configuration File
  9. Enabling PXE on Synology NAS
  10. Booting Ubuntu Desktop 20.04 LTS Live via PXE
  11. Booting Ubuntu Server 20.04 LTS via PXE
  12. Booting Fedora 35 Workstation Live via PXE
  13. Booting Ubuntu Desktop 22.04 LTS Live via PXE
  14. Booting Ubuntu Server 22.04 LTS via PXE
  15. Conclusion
  16. References

Creating a pxeboot Shared Folder

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

If you need any assistance on creating a new shared folder, read the article How to Setup Synology NAS?.

Enabling NFS for the pxeboot Shared Folder

You will also need to enable the NFS file service and configure the pxeboot shared folder for NFS access for the PXE booting to work.

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 screenshot below.

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 pxeboot shared folder, and click on Edit as marked in the screenshot below.

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/pxeboot as you can see 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 PXE boot firmware, you will need to 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 screenshot below.

Click on Select as marked in the screenshot below to set a TFTP roof 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

To get the PXE boot 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 screenshot below3.

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 the PXE booting 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 on Edit as marked in the screenshot below.

Check the Enable DHCP server checkbox from the DHCP Server tab as marked in the screenshot below.

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 will need it for your home network devices (i.e., laptops, desktops, smartphones, 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 2 DHCP servers, but the one configured on your Synology NAS will supply the required files for the PXE booting. No matter which DHCP server your home networking devices use, everything will work just 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 you can see in the screenshot below.

Check the Enabled checkbox to enable the subnet and click on OK as marked in the screenshot below.

Click on Yes.

DHCP should be enabled for your selected network interface.

Downloading PXELINUX

You can download the PXELINUX from the URL:

https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/

Visit the PXELINUX download URL from your favorite web browser. Once the page loads, download the zip archive of the latest version of syslinux. At the time of this writing, the latest version of syslinux is 6.03.

Your browser will prompt you to save the syslinux zip archive. Select a folder/directory of your choice and click on Save.

syslinux zip archive should be downloaded.

Right-click on the downloaded zip archive and click on Extract All… to extract the zip archive.

Click on Extract.

syslinux zip archive is being extracted. It will take a few seconds to complete.

At this point, the syslinux zip archive should be extracted. You will see a new syslinux folder/directory as you can see in the screenshot below.

The contents of the extracted syslinux folder/directory.

Uploading the Required Files to the NAS

Extracted syslinux folder/directory has a lot of folders and files. You don’t need all of them. You will have to upload only the required files from this folder/directory to the pxeboot shared folder of your Synology NAS.

From the syslinux/bios/core folder/directory1, drag and drop the pxelinux.0 file to the pxeboot shared folder to upload it2.

Click on Overwrite.

The pxelinux.0 file should be uploaded to the pxeboot shared folder.

In the same way, upload the linux.c32 file to the pxeboot shared folder from the syslinux/bios/com32/modules folder/directory.

Upload the libutil.c32 file to the pxeboot shared folder from the syslinux/bios/com32/libutil folder/directory.

Upload the ldlinux.c32 file to the pxeboot shared folder from the syslinux/bios/com32/elflink/ldlinux folder/directory.

Upload the memdisk file to the pxeboot shared folder from the syslinux/bios/memdisk folder/directory.

Upload the menu.c32 and vesamenu.c32 files to the pxeboot shared folder from the syslinux/bios/com32/menu folder/directory.

Upload the libcom32.c32 file to the pxeboot shared folder from the syslinux/bios/com32/lib folder/directory.

Once you’ve uploaded all the required files to the pxeboot shared folder from the syslinux folder/directory, the pxeboot shared folder should have the following files.

Creating a PXELINUX Default Configuration File

To be able to boot PXELINUX, you will need a default PXELINUX configuration file. The PXELINUX configuration files are kept in the pxelinux.cfg/ folder. You will have to create the pxelinux.cfg/ folder in the pxeboot shared folder.

To create the pxelinux.cfg/ folder, navigate to the pxeboot shared folder from the File Station app and click on Create > Create folder as marked in the screenshot below.

Type in pxelinux.cfg as the folder name and click on OK.

A new folder pxelinux.cfg should be created.

Create a default file in the pxelinux.cfg/ folder and type in the following lines in it. This is a simple PXELINUX configuration file. It will be used to test whether PXELINUX is working.

NOTE: You may install the Text Editor app from the Package Center and use it to create and edit text files on your Synology NAS.

default menu.c32
prompt 0
timeout 100

menu title Select an option to boot

label ubuntu-desktop-2004-live
    menu label Install Ubuntu Desktop 20.04 LTS

label ubuntu-server-2004-netboot
    menu label Install Ubuntu Server 20.04 LTS (netboot)

Enabling PXE on Synology NAS

Once you have created the pxelinux.cfg/default configuration file, you can enable the 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 screenshot below.

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

Select the file pxelinux.0 as the PXE Boot loader from the list and click on Select.

For the changes to take effect, click on Apply.

PXE should be enabled and the pxelinux.0 should be set as the PXE boot loader.

Now, if you boot your computer via PXE, you should see the following boot menu. It means that PXELINUX is working.

Booting Ubuntu Desktop 20.04 LTS Live via PXE

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 pxeboot 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 screenshot below.

Make sure that the ISO image is mounted in the pxeboot shared folder1. Also, make sure 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 pxeboot shared folder as you can see in the screenshot below.

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

To boot Ubuntu Desktop 20.04 LTS via PXE, you will have to add a menu entry for Ubuntu Desktop 20.04 LTS on the pxelinux.cfg/default configuration file.

Type in the following lines in the pxelinux.cfg/default configuration file to boot Ubuntu Desktop 20.04 LTS via PXE:

label ubuntu-desktop-2004-live
    menu label Install Ubuntu Desktop 20.04 LTS
    kernel ubuntu-20.04.4-desktop-amd64/casper/vmlinuz
    append boot=casper maybe-ubiquity netboot=nfs ip=dhcp nfsroot=192.168.0.106:/volume1/pxeboot/ubuntu-20.04.4-desktop-amd64 initrd=ubuntu-20.04.4-desktop-amd64/casper/initrd

Once you’ve added a menu entry for Ubuntu Desktop 20.04 LTS, the pxelinux.cfg/default configuration file should look as follows:

NOTE: Here, 192.168.0.106 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, boot your computer via PXE and you should see the following boot menu.

Select Install Ubuntu Desktop 20.04 LTS 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.

Once the vmlinuz and initrd files are downloaded, Ubuntu Desktop 20.04 LTS Live should start to boot. It will take a while to complete.

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 Live network booted via PXE.

Booting Ubuntu Server 20.04 LTS via PXE

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 pxeboot 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 screenshot below.

Make sure that the ISO image is mounted in the pxeboot shared folder1. Also, make sure 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 pxeboot shared folder as you can see in the screenshot below.

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

To boot Ubuntu Server 20.04 LTS via PXE, you will have to add a menu entry for Ubuntu Server 20.04 LTS on the pxelinux.cfg/default configuration file.

Type in the following lines in the pxelinux.cfg/default configuration file to boot Ubuntu Server 20.04 LTS via PXE:

label ubuntu-server-2004-netboot
    menu label Install Ubuntu Server 20.04 LTS (netboot)
    kernel ubuntu-20.04.4-live-server-amd64/casper/vmlinuz
    append netboot=nfs ip=dhcp nfsroot=192.168.0.106:/volume1/pxeboot/ubuntu-20.04.4-live-server-amd64 initrd=ubuntu-20.04.4-live-server-amd64/casper/initrd

Once you’ve added a menu entry for Ubuntu Server 20.04 LTS, the pxelinux.cfg/default configuration file should look as follows:

NOTE: Here, 192.168.0.106 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, boot your computer via PXE and you should see the following boot menu.

Select Install Ubuntu Server 20.04 LTS (netboot) 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.

Once the vmlinuz and initrd files are downloaded, Ubuntu Server 20.04 LTS should start to boot. It will take a while to complete.

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 as usual. If you need any assistance in installing Ubuntu Server 20.04 LTS on your computer/server, read the article Installing Ubuntu Server 20.04 LTS.

Booting Fedora 35 Workstation Live via PXE

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

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

Right-click on the Fedora Workstation 35 ISO image and click on Mount Virtual Drive as marked in the screenshot below.

Make sure that the ISO image is mounted in the pxeboot shared folder1. Also, make sure 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 35 should be mounted in the pxeboot shared folder as you can see in the screenshot below.

The contents of the mounted Fedora Workstation 35 ISO image.

To boot Fedora Workstation 35 Live via PXE, you will have to add a menu entry for Fedora Workstation 35 on the pxelinux.cfg/default configuration file.

Type in the following lines in the pxelinux.cfg/default configuration file to boot Fedora Workstation 35 Live via PXE:

label fedora-35-workstation-live
    menu label Install Fedora Workstation 35
    kernel Fedora-Workstation-Live-x86_64-35-1.2/images/pxeboot/vmlinuz
    append ip=dhcp rd.live.image root=live:nfs://192.168.0.106/volume1/pxeboot/Fedora-Workstation-Live-x86_64-35-1.2/LiveOS/squashfs.img initrd=Fedora-Workstation-Live-x86_64-35-1.2/images/pxeboot/initrd.img

Once you’ve added a menu entry for Fedora Workstation 35, the pxelinux.cfg/default configuration file should look as follows:

NOTE: Here, 192.168.0.106 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, boot your computer via PXE and you should see the following boot menu.

Select Install Fedora Workstation 35 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.

Once the vmlinuz and initrd files are downloaded, Fedora Workstation 35 Live should start to boot. It will take a while to complete.

Fedora Workstation 35 Live is being booted.

Once Fedora Workstation 35 Live is booted, you should see the following window. You can install Fedora Workstation 35 on your computer as usual from here. If you need any assistance in installing Fedora Workstation 35 on your computer, read the article How to Install Fedora Workstation 35 from USB.

Fedora Workstation 35 installer once booted via PXE.

Booting Ubuntu Desktop 22.04 LTS Live via PXE

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 pxeboot 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 screenshot below.

Make sure that the ISO image is mounted in the pxeboot shared folder1. Also, make sure 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 pxeboot shared folder as you can see in the screenshot below.

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

To boot Ubuntu Desktop 22.04 LTS via PXE, you will have to add a menu entry for Ubuntu Desktop 22.04 LTS on the pxelinux.cfg/default configuration file.

Type in the following lines in the pxelinux.cfg/default configuration file to boot Ubuntu Desktop 22.04 LTS via PXE:

label ubuntu-desktop-2204-live
    menu label Install Ubuntu Desktop 22.04 LTS
    kernel ubuntu-22.04-desktop-amd64/casper/vmlinuz
    append initrd=ubuntu-22.04-desktop-amd64/casper/initrd boot=casper netboot=nfs ip=dhcp nfsroot=192.168.0.106:/volume1/pxeboot/ubuntu-22.04-desktop-amd64 maybe-ubiquity quiet splash ---

Once you’ve added a menu entry for Ubuntu Desktop 22.04 LTS, the pxelinux.cfg/default configuration file should look as follows:

NOTE: Here, 192.168.0.106 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, boot your computer via PXE and you should see the following boot menu.

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

Ubuntu Desktop 22.04 LTS Live is being booted. It will take a while to complete.

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 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.

Ubuntu Desktop 22.04 LTS Live network booted via PXE.

Booting Ubuntu Server 22.04 LTS via PXE

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 pxeboot 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 screenshot below.

Make sure that the ISO image is mounted in the pxeboot shared folder1. Also, make sure 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 pxeboot shared folder as you can see in the screenshot below.

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

To boot Ubuntu Server 22.04 LTS via PXE, you will have to add a menu entry for Ubuntu Server 22.04 LTS on the pxelinux.cfg/default configuration file.

Type in the following lines in the pxelinux.cfg/default configuration file to boot Ubuntu Server 22.04 LTS via PXE:

label ubuntu-server-2204-netboot
    menu label Install Ubuntu Server 22.04 LTS (netboot)
    kernel ubuntu-22.04-live-server-amd64/casper/vmlinuz
    append netboot=nfs ip=dhcp nfsroot=192.168.0.106:/volume1/pxeboot/ubuntu-22.04-live-server-amd64 initrd=ubuntu-22.04-live-server-amd64/casper/initrd

Once you’ve added a menu entry for Ubuntu Server 22.04 LTS, the pxelinux.cfg/default configuration file should look as follows:

NOTE: Here, 192.168.0.106 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, boot your computer via PXE and you should see the following boot menu.

Select Install Ubuntu Server 22.04 LTS (netboot) 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.

Once the vmlinuz and initrd files are downloaded, Ubuntu Server 22.04 LTS should start to boot. It will take a while to complete.

Ubuntu Server 20.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 as usual. 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.

Conclusion

In this article, I have shown you how to configure the TFTP and NFS file services on your Synology NAS for the PXE booting. I have also shown you how to download the PXELINUX, copy the necessary PXELINUX files to your Synology NAS, and install and configure the DHCP Server package for booting the PXELINUX on BIOS-based motherboards. I have shown you how to add the necessary PXELINUX menu entries for the PXE booting for the following Linux distributions:

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

References

  1. https://c-nergy.be/blog/?p=13808
  2. https://ubuntu.com/server/docs/install/netboot-amd64
  3. https://linuxhint.com/pxe_boot_ubuntu_server/
  4. http://manpages.ubuntu.com/manpages/bionic/man7/casper.7.html
  5. https://fedoraproject.org/wiki/Dracut/Options#NFS
  6. https://man7.org/linux/man-pages/man7/dracut.cmdline.7.html
  7. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-disklesssystems
  8. https://bugzilla.redhat.com/show_bug.cgi?id=781983
  9. https://bugzilla.redhat.com/show_bug.cgi?id=537217
  10. https://askubuntu.com/questions/1250119/how-to-skip-filesystem-checks-during-boot

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.