How to install PXE Server on Ubuntu 16.04

You may also like...

  • Think Strategy

    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.

  • SK

    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 192.168.1.105;”. 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

      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 (192.168.1.105) 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 (192.168.1.105).

      allow booting;
      allow bootp;
      option option-128 code 128 = string;
      option option-129 code 129 = text;
      next-server 192.168.1.105;
      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

        Good luck mate. Hope you find a solution.

        • Think Strategy

          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;
          next-server 192.168.1.105;
          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

            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.

  • Jeff6times7

    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

      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(192.168.1.105 for example on this page)

  • Tahir Muzaffar

    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=http://192.168.1.105/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz
    ramdisk_size=16432 root=/dev/rd/0 rw —

    • SK

      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.

  • Alhaji Abubakari Sadiq

    this is so nice.Thanks

  • ali

    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

    • SK

      Glad It helped you. I will soon make a guide on a multi-distribution setup.

  • Geroo

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