Boot from any ISO on your Network using PXE

 

Configure PXE Boot

Enable PXE & TFTP Server on your NAS.  In this specific guide, I will be storing build media and PXE boot image on the NAS; and the DHCP server on the router (ASUS RT-AC5300).  So the router will be forwarding PXE boot TFTP requests (port 69/UDP) to the NAS.

I have an Asus RT-AC5300 with Merlin.  This adds additional features not available in the stock firmware (e.g PXE support).  I want to keep the DHCP (and PXE) server enabled on my router, as my NAS is not on 24/7.

Credit to http://programmingflow.com/2015/04/08/boot-any-machine-in-your-home-with-pxe.html for information about how to direct TFTP requests in Merlin.

Asus Merlin & DNSmasq Reference

  • Make sure you enable JFFS on your router.
  • Login to your router with SSH
  • Create file /jffs/configs/dnsmasq.conf.add and paste this
    dhcp-boot=pxelinux.0,,10.0.0.x

    where 10.0.0.x is the LAN IP of a Synology NAS.
    Note: ,, is not a mistake!

The first option specifies the bootfile to load.  The second (blank) parameter is the hostname of the TFTP server, and the last parameter is the IP address of the TFTP server.  Having the “.add” file extension in the dnsmasq .conf ensures that the config is appended to dnsmasq.conf and not overwriting it.

So now we have the Synology responding to TFTP requests, but we need to actually configure the TFTP server to do something.  Simply download the zip and extract to the root of your TFTP server.  Note the pxelinux.0 boot file that this already comes with.

Copy your ISO to <tftproot>/images

You’ll need to edit the pxelinux.cfg/default file which will contain the boot menu entries.  File paths and filenames are case-sensitive!

Mine looks like this:

default menu.c32
prompt 0
timeout 100
ONTIMEOUT local
PATH boot

LABEL local
 MENU LABEL Boot local hard drive
 LOCALBOOT 0

LABEL chainlocal
 MENU LABEL Chain boot to local hard drive
 KERNEL chain.c32
 APPEND hd0 
 
LABEL Win10
 MENU LABEL Install Win 10 x64
 LINUX memdisk
 APPEND iso raw
 INITRD images/Win10x64.iso
  • default menu.c32 sets the default menu style. “menu.c32” is the text-based style with a blue background. Alternative for this would be the graphical menu style “vesamenu.c32”. Since it takes several steps from here and I’m here on the essentials, I will not go into the graphical menu style here.
  • Prompt 0 means that the focus is when loading the PXE boat screen on the first entry. (0 = 1st entry, 1 = 2nd entry … etc.)
  • timeout 100 means that after 10.0 seconds, the user is automatically selected without the user’s interaction, which was stored with ONTIMEOUT . In this case “chainlocal”.

Now follow the individual menu items, whose order can be changed as desired. An entry is organized as follows:

  • LABEL is simply the name of the entry in the configuration file itself. This must consist of one word (without spaces or special characters), is totally irrelevant and does not occur anywhere else and is only for orientation in the configuration file. All further points are LABEL’s subpages and are merely an optic (no must!)
    • MENU LABEL The title of the entry in the PXE boot menu is defined here and can be selected freely.
    • KERNEL This specifies the path to the (Linux) kernel used. The path is always from the above selected “TFTP root folder”. Later (with exceptions) all kernels are in “images / …”
    • APPEND Here, certain parameters can be specified for the individual kernels. These differ from kernel to kernel. This line can be quite long for some images by specifying many parameters. We must take care not to interrupt this line by a line break!
    • LOCALBOOT 0 is the entry, which should always be the first and simply boot the first local hard disk.

 

Now you’ll be able to PXE boot and the following PXE boot menu will appear:

 

 

Advertisements

5 thoughts on “Boot from any ISO on your Network using PXE

  1. Thanks for this!

    Just wondering if the ISO you are booting to is the Windows 10 installation ISO or a fully installed Windows 10? I’m thinking it maybe possible to PXE boot to the Windows 10 / Ubuntu installation media and possibly then install Windows 10 / Ubuntu to an iSCSI LUN on the Synology so that the client is completely diskless?

    Like

    1. It’s the windows 10 installation iso. I’m not sure that’d work as you may have issues with the windows 10 installation media seeing the iscsi luns due to lack of drivers in the boot media

      Like

    1. Hi. Sorry I’ve been a bit inactive. Is there anything specifically you’re interested in? I was thinking the next thing to write about would be about sonarr and sabnzbd

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s