Something I’ve been meaning to do for a while now, is setup my Synology NAS as a PXE boot server.

I want to be able to easily install new Operating systems on any new hardware I get, but more importantly, to easily install multiple Virtual Machines on my primary workstation without too much hassle.
This will involve setting up the Synology as TFTP server , supplying the correct PXE files (images and configuration) , and also configuring my DHCP server .

The official documentation from Synology is woefully inadequate to get PXE up and running, it is missing a number of vital steps.
(https://www.synology.com/en-us/knowledgebase/DSM/tutorial/General/How_to_implement_PXE_with_Synology_NAS)

Configure TFTP on Synology

Luckily, there are other sources on the internet.

Prepare a shared folder/volume. In my case, I have a shared volume named “shared” , where I created a folder “PXEBOOT”

Go to Main Menu > Control Panel > File Services and select the TFTP tab.
Tick Enable TFTP service.
Image:Synology TFTP server for PXE Boot

Enter the folder you prepared earlier.

Now you need to add the folder structure for TFTP to be able to show a boot menu , and prepare the images.

Check out this exellent guide, that contains a link to a zip file with a configuration that contains CentOS and Ubuntu images.

https://synology.wordpress.com/2017/10/05/boot-from-any-iso-on-your-network-using-pxe/

(it actually uses this Github repository : https://github.com/paulmaunders/TFTP-PXE-Boot-Server )

The Github repository is not quite up to date, but it’s easy to add newer images, I’ve added Ubuntu 18.04 and CentOS 7.5 . It is configured to use the netinstall (http) method, so you do need an internet connection.

Unzip it, and put it on your shared folder, on your Synology, so it looks like this:
Image:Synology TFTP server for PXE Boot

Verify TFTP

I’m using Redhat 7.5 , and I wanted to quickly test TFTP. Unfortunately, the tftp client is not a part of my configured repositories , so I just downloaded a client from http://rpmfind.net/.

tftp  
(to) <ip address of synology>  
tftp> verbose  
Verbose mode on.  
tftp> get pxelinux.0  
getting from <ip address of synology>:pxelinux.0 to pxelinux.0 [netascii]  
Received 26579 bytes in 0.2 seconds [1063767 bit/s]  
tftp>  

This indicates that the location of `pxelinux.0, that needs to be configured in the DHCP server, is in the root of the TFTP server and is accessible by everyone.

Configure Ubiquity Edge Router’s DHCP

A very complete guide to do this can be found here. You need to use the Ubiquity CLI to do it.
https://blog.laslabs.com/2013/05/pxe-booting-with-ubiquiti-edgerouter/

I’ve configured the following (result of show service dhcp-server )

shared-network-name LAN2 {
    authoritative disable
    subnet 192.168.1.0/24 {
        bootfile-name /pxelinux.0
        bootfile-server <ip address of synology>
        default-router 192.168.1.0
        dns-server 192.168.1.1
        dns-server 8.8.8.8
        domain-name gwbasics.be
        ....
        subnet-parameters "filename &quot;/pxelinux.0&quot;;"
    }  
}  
use-dnsmasq disable  

Note that you must use the &quote; syntax !

The following commands were used :

configure  
edit service dhcp-server shared-network-name LAN2 subnet 192.168.1.0/24  
set subnet-parameters "filename &quot;/pxelinux.0&quot;;"  
set bootfile-name /pxelinux.0  
set bootfile-server <ip address of synology>  
commit 
save  
show service dhcp-server  

Issuing a new “set” command does not overwrite a value, instead it adds a new line. You need to remove the entries that are not correct (if you have multiple lines) :

show service dhcp-server  
configure  
edit service dhcp-server shared-network-name LAN2 subnet 192.168.1.0/24  
delete subnet-parameters "filename &quot;/shared/PXEBOOT/pxelinux.0&quot;;"
commit  
save  
show service dhcp-server  

If you have multiple lines or wrong lines, you will see PXE errors in the boot screen .

VMWare workstation

Lastly, I need to configure VMWare workstation.
2 important things here :

  • I added a bridged network adapter , to obtain a dhcp address from my home network . This adapter will receive the pxe boot instructions.

  • I increased the memory size from 1024 MB to 2048 MB, because the CentOS 7.5 installer complained about “no space left on device” on the /tmp drive during installation (which effectively means, in memory).

Image:Synology TFTP server for PXE Boot

When booting, now get the configured menu options from my PXE boot server ….

Image:Synology TFTP server for PXE Boot

Then step through the installation options as you would perform a normal manual installation. Of course it’s also possible to prepare automated installations, but that is another topic.