How to install PXE Server on Ubuntu 16.04

25 Responses

  1. Think Strategy says:

    I do have some questions regarding this tutorial.

    1. My router is handling the ip addresses. Can i install the PXE-Server without DHCP on my Linux Ubuntu Server?

    2. I have couple of months ago installed Windows Server 2012 in Virtualbox (using PHPVirtualbox) for the reason to have WDS. In case of wanting to install a Linux distro there is no problem because i would have Windows Server 2012 offline. However if i want to have a Windows version installed using WDS, will this collide with PXE-Server? If so which i ASSUME, i just have to shutdown PXE-Server for the time being right?

    sudo systemctl stop tftpd-hpa

    In the back of my mind, i know the answer to the second question, but i want to be sure of the answer. Regarding question 1 i seriously do not know if this is the case.

  2. SK says:

    For the question number 1, I didn’t check PXE server with router. However, I assume we can do this by replacing the next-server IP address with your router IP. Check the “Configuring DHCP Server settings” section. I have mentioned the DHCP server IP as “next-server;”. May be you should replace this value to your router address and try.

    And for the question number 2, PXE server and WDS won’t collide with each other if you use different IP address. This is also my assumption. I am not sure, because I really have no idea about Windows. I couldn’t help you. Sorry.

    If you find any solutions, please share them here. I will update the tutorial with your points. SO that other users can also benefit. Thank you.

    • Think Strategy says:

      After you replied i had my suspicion about that it might not work, but i decided to try it first in a test-environment. Sadly my suspicions were right.

      The ip address you set up for the PXE-Server ( is also the DHCP-server. When you try to boot a client to it, it will ask for a ip address from an DHCP-Server which happens on port 67. Which off course the client will receive. However, when you configured ¨/etc/dhcp/dhcpd.conf¨, there you told the DHCP-Server if a client might ask for a PXE-Server it can be found on address (

      allow booting;
      allow bootp;
      option option-128 code 128 = string;
      option option-129 code 129 = text;
      filename “pxelinux.0”;

      In my case the situation is that the Linux Ubuntu Server does NOT have a DHCP-Server, so some other way needs to be setup to tell clients where to find the PXE-Server.

      In case of Microsoft WDS I THINK it broadcasts a package through out the network to find out which ip the WDS is having.

      Thanks anyway your tutorial is much more simple to configure and understand then other tutorials i read about PXE-Server.

      Gonna look on the web if there is a way to bypass this problem, if i find a way, ill let you know.

      • SK says:

        Good luck mate. Hope you find a solution.

        • Think Strategy says:

          Sk, Brother, i found a solution to the problem, although you need to make some HARDWARE/Software network configuration changes.

          (do keep in mind this is still a theory, because i have not yet test it in real life).

          In the case that we talked about

          allow booting;
          allow bootp;
          option option-128 code 128 = string;
          option option-129 code 129 = text;
          filename “pxelinux.0”;

          The next-server(PXE server) is being pointed at in the DHCP file, but this is being done on the machine that is running the DHCP-server in the case you described is also the PXE-Server. If you are running a router/machine on openWRT or whatever Linux machine as DHCP-Server, this could be achieved. This theoretically could be achieved in even using a Raspberry pi as the openWRT/Linux router as the DHCP-Server, because it could be on 24/7 and not really using a lot of energy.

          In my case, i have already ordered a few months ago Turris Omnia router running a modified version of OpenWRT, so this theoretically could be achieved.

          I still have to receive it, i´ll let you know if it indeed can be solved/is like my theory.

          • SK says:

            Thank you brother. I hope this solution will work. Once you got the solution, please let me know. I will update your notes in the article. Thanks again. Much appreciated.

  3. Jeff6times7 says:

    I followed all the instructions and when the installer began to download the installation components from a mirror, it failed because it couldn’t resolve the address of the mirror. I opened a shell and added my router’s IP address as an additional nameserver. As of now, it has installed the base system and I think there’s not much left in the installation process.

    • Ravi Shekhar Jethani says:

      I think you selected a country mirror. And by adding router’s IP address you are actually allowing access to the internet. So in your case all the installation files are coming from internet not the local LAN. Solution: While choosing mirror scroll to the top and manually enter the pxe server ip( for example on this page)

  4. Tahir Muzaffar says:

    Please let me know what modification should i make in these commands if i want to install ununtu server text mode only?????
    label linux
    kernel ubuntu-installer/i386/linux
    append ks= vga=normal initrd=ubuntu-installer/i386/initrd.gz
    ramdisk_size=16432 root=/dev/rd/0 rw —

    • SK says:

      You don’t have to change anything. Just mount the Ubuntu server ISO and continue the installation. Ubuntu server OS doesn’t has any graphical DE.

  5. Alhaji Abubakari Sadiq says:

    this is so nice.Thanks

  6. ali says:

    When do you think you’ll publish a post on a multi distribution setup? This worked perfectly,, but keen to get a couple of distros and a nice menu for my lab

  7. Geroo says:

    Anyone has any idea how to make this works for windows installation ??

  8. Israel Moldes Feijóo says:

    I’m trying to deploy Xubuntu 16.04.3 LTS but there is no netboot folder inside the install folder. It just contains three files: mt86plus, README.sbm and sbm.bin. Should I copy these files to /var/lib/tftpboot/?

  9. Garrett Strahan says:

    Help please, Having some issues here with this guide:

    systemctl status tftpd-hpa.service
    ● tftpd-hpa.service – LSB: HPA’s tftp server
    Loaded: loaded (/etc/init.d/tftpd-hpa; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Tue 2018-01-30 11:15:03 PST; 33min ago
    Docs: man:systemd-sysv-generator(8)
    Process: 1449 ExecStart=/etc/init.d/tftpd-hpa start (code=exited, status=127)

    Jan 30 11:15:03 PXE-R620 systemd[1]: Starting LSB: HPA’s tftp server…
    Jan 30 11:15:03 PXE-R620 tftpd-hpa[1449]: /etc/init.d/tftpd-hpa: 8: /etc/default/tftpd-hpa: -s: not found
    Jan 30 11:15:03 PXE-R620 systemd[1]: tftpd-hpa.service: Control process exited, code=exited status=127
    Jan 30 11:15:03 PXE-R620 systemd[1]: Failed to start LSB: HPA’s tftp server.
    Jan 30 11:15:03 PXE-R620 systemd[1]: tftpd-hpa.service: Unit entered failed state.
    Jan 30 11:15:03 PXE-R620 systemd[1]: tftpd-hpa.service: Failed with result ‘exit-code’.


    OPTIONS=-l -s /var/lib/tftpboot

  10. Bob Shaw says:

    Same here, on a fresh install of Ubuntu 16.04 as well. It’d be great to hear a solution for this!

  11. Navajo Demar says:

    First off, thank you for the great tutorial, it works great. Only issue is that it seems to be reaching out to the external sites and not using the http url I set up in the append area for the menu selection. I see it contact it once and read the KS. Do I need to modify the ks file?

  12. Abhishek Chavhan says:

    It works. However, explore multi Linux distros deployment using a single pxe server.

  13. Adam says:

    is there any reason this would be different to running LAMP on an ubuntu Virtual Machine. As in you just port forward your Virtual Machine running PXE and DHCP bypassing your router into your Virtual Machine that is running apache etc, giving you a webserver.

    for people who don’t have another PC or have an ok PC that want to play around with it

  14. Sebastia says:

    I have mounted “ubuntu-16.04.6-server-amd64.iso” but directory “/mnt/install” has only one file : “mt86plus”
    There is no “netboot” directory
    What am I doing wrong ?

    • Sebastia says:

      The required files are ONLY in the “.0” iso,
      so you have to download “ubuntu-16.04-server-amd64.iso”,
      and not “ubuntu-16.04.6-server-amd64.iso”

  15. Sebastia says:

    There is a point I dont understand :
    a) you want to configure /etc/inetd.conf, including a “tftp” line, so inetd daemon shall control tftp
    b) then you use “sudo systemctl restart tftpd-hpa” as if it was a system service
    If tftp server starts two times, we are in trouble

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.