PXE Boot any ISO Image


This post is in the category: Guides

Posts here are mostly step-by-step guides on how to replicate something I have set up in the past. Read over my About page to see how I show commands/output and read the disclaimer.


There are several rescue utilities out there that run in the form of a bootable ISO, but what if you already have a functioning PXE server and don’t have a CD? There is a way to load it over the network.

This guide is intended for ISOs that have no PXE boot option. Do not try to serve something like an Ubuntu ISO using this method! Most if not all Linux distributions have a separate PXE configuration that does not require this workaround.

You will need a PXE server configured similar to my guide on creating an Ubuntu deployment server. If you are creating a PXE server for this guide’s purpose, you only need to complete the Ubuntu deployment server guide up to Checkpoint Two.

Once you have the PXE server setup, you will need to also have memdisk in the TFTP boot folder. Memdisk is part of syslinux, and can be downloaded here.

[root]$ wget https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-5.10.tar.gz
[root]$ tar -xzvf syslinux-*.tar.gz

This is the source, so we need to compile it after we install a couple dependencies.

[root]$ apt-get install nasm
[root]$ cd syslinux-*/memdisk
[root]$ make memdisk

Now lets copy over the memdisk binary.

[root]$ mkdir /var/lib/tftpboot/other
[root]$ cp /root/syslinux-*/memdisk/memdisk /var/lib/tftpboot/other/

Also, take the ISO that you are looking to PXE boot in that same directory (/var/lib/tftpboot/other/). After I saved my ISO to that same directory, my directory structure looked like this.

/var/lib/tftpboot
├── other
│   ├── memdisk
│   └── SymantecEncryptionDesktop10.3.0MP1Win32_WDE_Recovery.iso
├── pxelinux.0
├── pxelinux.cfg
│   └── default
├── ubuntu
│   ├── amd64
│   │   ├── initrd.gz
│   │   └── linux
│   └── i386
│       ├── initrd.gz
│       └── linux
└── vesamenu.c32

In the file /var/lib/tftpboot/pxelinux.cfg/default, add this menu entry. Replace the ISO and menu labels accordingly.

label wde
    menu label WDE Recovery
    root (hd0,0)
    kernel other/memdisk
    append iso initrd=other/SymantecEncryptionDesktop10.3.0MP1Win32_WDE_Recovery.iso raw

In my case, I am attempting to PXE boot machines into a recovery disk provided by Symantec without having to burn the disk.

Now any machine can be booted to this ISO. Simple!

This entry was posted in Guides and tagged , on by .

About Andrew Wells

I have been developing on the LAMP stack since about 2006. I run Ubuntu XFCE on my desktop and have a history of managing Ubuntu and CentOS servers. I code web applications mostly in PHP but have experience with other languages as well. When I'm not working, I can be found working in my home lab or out snowboarding, hiking, camping, or biking depending on the season.

16 thoughts on “PXE Boot any ISO Image

    1. Andrew Wells Post author

      I suppose you don’t need the memdisk option, but it’s good to have to make sure the environment works before adding the variable of an ISO image.

      The root parameter is related to the local disk and I believe is not required in this case.

      Reply
  1. Brian

    Hi Andrew, I came across your stie while looking for a howto for pxe booting isos. I’ve followed your two guides and i’m currently at this stage when I boot from pxe…..

    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    C. —-
    B. —-
    A. Boot from local disk
    A. Boot from local disk
    A. Boot from local disk
    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    PXEBS (net1 type 128)… ok
    Next server: 192.168.15.254
    Filename: pxelinux.0
    tftp://192.168.15.254/pxelinux.0… No such file or directory (http://ipxe.org/2
    d12603b)

    Installing dnsmasq didn’t create the folder /var/lib/tftpboot I had to do that manually. I only have one iso file that I want to be able to boot from.

    Reply
  2. Brian

    Got a bit further now it says

    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    C. —-
    B. —-
    A. Boot from local disk
    A. Boot from local disk
    A. Boot from local disk
    D. Ubuntu OS Deployment – DATA LOSS AHEAD!!
    PXEBS (net1 type 128)… ok
    Next server: 192.168.15.254
    Filename: pxelinux.0
    tftp://192.168.15.254/pxelinux.0… ok

    then hangs

    Reply
  3. Brian

    I’ve now got this on the pxe server

    Sep 19 22:07:46 apu dnsmasq-tftp[2397]: sent /srv/tftp/pxelinux.cfg/default to 192.168.15.119

    but the client just hangs?

    Reply
  4. Pingqing Wei

    Hi, Andrew,

    Thanks for your guide. By PXE, I can install a ISO which is customized by my self. But I encounter a problem. The size of my ISO file is 1.5G, when a low memory PXE client boots from the ISO, an error which shows NOT enough memory will appear. Could you give me some advice? Thanks!!!

    Reply
  5. Brian

    Hi Andrew please could you drop me an email as I would like a quick hand with pxe boot, there will be beer tokens 😉

    Reply
  6. Jarkko R.

    Hi!

    Thanks for the tutorial, but I’m now confronting some special issues. I’m trying to boot a Sophos UTM 9 installation over PXE, it is distributed via ISO too. The installation will stop since you haven’t got everything mounted (install.tar in particular, maybe the whole /install directory too), and this happens with a USB drive too. Solution with a USB drive is to mount the drive via console that is provided during the installation.

    Do you have any solution to this, how could I provide a whole directory via PXE to be mounted on the running software. Or is it impossible?

    Reply
  7. Jay C

    Thanks for the tip. I had been spending most of the night trying to boot a server to ESXi hypervisor, but the CD drive was bad, and no amount of USB booting would work. This did the trick.

    Reply
  8. Tim

    Can you do something like this with a Windows Server 2008 PXE server setup? So you can pxe boot to other bootable images other than Windows .wim files?

    Reply
  9. fdisk101

    am looking to make a pxe boot iso that will work off dhcp, connect to say an ftp server, then show a menu that offers up several install options for Centos, Debian or Mint, sort of thin. Because of other systems on the network i cant pxe boot and am hoping to be able to boot from iso or usb to install onto local hd.
    Is the above possible using your boot environment?

    ta in advance

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *