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

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

    1. Sorry I’m not sure. I tend to just find random articles where there’s a need for something. If you find a useful site be sure to let me know

      Like

  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

  2. Hello. I cant enable pxe on my synology without enable dhcp there which is in conflict with my router and finally can not be enabled either dhcp and pxe on synology ( only one dhcp on subnet ). How to overcome that problem ?

    Like

    1. You need a managed switch to create a separate VLAN or create a new subnet with an unmanaged switch and run a dhcp server on a those separate subnets. You can’t have two dhcp servers on the same subnet so segmentation or disable one of the dhcp servers is your only option

      Like

  3. Hello,
    im my case PXE-Boot doesn’t work: When starting the PC –> PXE Boot Menu appears. I can choose the wanted installation (in my case it is an iso-file I built with AMOEI PE Builder – about 300 Mb)…then at the bottom of the screen I see “WinPE Image loading” ……and then nothing happens….the dots in the line getting more and more….after 40 minutes I stopped it….I tried it with several different images….always the same….is it a known issue??
    Rainer

    Like

      1. The issue occurs also with other iso-images i.e. CentOS-installation or ubuntu-installation or UltimateBootCD (ubcd537.iso)….

        Like

  4. Thanks for this guide! a couple of questions before I look at trying this myself:

    (1) Does this require legacy/UEFI boot at the client or does it work with all types?
    (2) Is there any reason why you chose normal PXE boot and not iPXE boot?
    (3) What is the difference between “local” and “chainlocal” boot? Do both just fall back to booting from the local hard disk if selected?
    (4) Is there anyway to add options to fallback to booting from a local USB device? This would be useful for installing another OS on an USB and controlling at the pxe network menu level whether the device boots from local harddisk or USB?

    Thanks!

    Like

    1. Hi there,

      1. It should work for both, but obviously, you can only point to one network boot program. With a legacy boot, it’ll point to an executable like a .com. For UEFI, you’d typically point it at a .efi file.

      2. PXE is the standard developed by Intel and adopted in the Windows world. You could use this implementation to point to a PXE enabled distribution point in an SCCM environment, or Windows Deployment Services. I’m not familiar with iPXE other than the fact that it’s the open source implementation of PXE.

      3. Sorry, I’m not sure what that is.

      4. No, you’d have to develop this logic into the network boot program. PXE is quite basic, and it’s basically just the PXE server telling the client to download the necessary programs and to launch it. That’s pretty much it.

      Like

      1. Thanks! I’m trying to get this working as per your example… Have entered the dnsmasq config additions on the Asus Merlin router (and rebooted) and have configured the TFTP server on the Synology NAS…

        The TFTP log shows the following as a UEFI VM (running on the synology) is powered up but no menu is displayed? I also tried a BIOS VM (running on the synology) but that doesn’t seem to have the option to/attempt to boot from LAN?

        Any ideas what could be going wrong here?

        Synology TFTP File Transfer Log
        Log = TFTP file transfer
        Date/Time = of VM start
        IP Address =
        User = —
        Event = get
        File/Folder = File
        File size = 25.96kb
        File name = /PXE/pxelinux.0

        Like

      2. I think your hunch is right. If you can’t specify the boot order then chances are it’ll be trying to boot off an iso or hard drive with no option for lan boot. I used hyper-v and vmware workstation which allows you to boot the VMs from network. Vmware workstation comes with a 30 day trial and hyper-v is free so try those to rule out any other issues.

        Also I encountered an issue with the vmware scsi drivers not being supported by the default winpe image. So I ended up injecting the drivers into the boot image.

        What iso are you trying to boot? If it’s a windows ISO you will most likely encounter the same problem on anything other than hyper-v.

        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