How to install Linux from the network

    Just yesterday, the Arceny habrayuzer told us about installing debian from USB-flash . In the article, he mentioned the possibility of installing “Using boot over the network ( PXE boot)”, so I decided to finally write material on creating the pxe boot server.

    The narration will be conducted on the example of the same OS - Debian (so your paths and commands may differ).
    To get started - put the tftp server. We look at the available options ( apt-cache search tftp | fgrep server ):
    • atftpd
    • dnsmasq
    • tftpd
    • tftpd-hpa
    First I set tftpd-hpa, because it was described in the manual with which I started creating the server. Then I switched to atftpd, because I needed logging. Consider both options:
    • tftpd-hpa:
      Install the package, edit the file / etc / default / tftpd-hpa , so that the demon knows that he should live: Create the desired directory: mkdir / var / lib / tftpboot , and start the invoke-rc.d tftpd-hpa service start

      #Defaults for tftpd-hpa
      OPTIONS="-l -s /var/lib/tftpboot"

    • atftpd:
      After installation, we find that by default this service works through inetd. For some reason, I'm not a fan of this method, so the first thing I did was comment out the corresponding line in /etc/inetd.conf . Then we edit / etc / default / atftpd : --tftpd-timeout - stream lifetime, in the absence of requests --retry-timeout - file upload timeout ; I have large timeouts set, because the service is broadcast to the city local network, which periodically bends from the abundance of subscribers, and does not cope with the flow of requests. Well, as in the previous paragraph, we create the necessary directory: mkdir / var / lib / tftpboot , and start the invoke-rc.d atftpd start service

      OPTIONS="--daemon --tftpd-timeout 1500 --no-multicast --retry-timeout 20 --logfile /var/log/atftpd.log --maxthread 100 --verbose=5 /var/lib/tftpboot"

    Now we have a tftp server. We took one step :)
    Next - dhcp configuration:
    • dhcp3:
      Add the boot information to the configuration file /etc/dhcp3/dhcpd.conf : If tftpd is installed on the same server as dhcpd, the next-server directive can be omitted. And restart dhcp3-server: invoke-rc.d dhcp3-server restart

      filename "pxelinux.0";
      next-server ;

    • dnsmasq:
      In the /etc/dnsmasq.conf config , add: Again, if the tftp and dhcp servers are the same, you can leave the last 2 attributes blank. Restarting: invoke-rc.d dnsmasq restart


    Step two is passed. Next - directly configure the pxe-boot.
    We go to , select the installer- * directory corresponding to the necessary architecture. Then we go to the current / images / netboot directory inside we will find the netboot.tar.gz and gtk / netboot.tar.gz files - these are the text and image installation files, respectively. We select the one we like, download and unpack it in / var / lib / tftpboot .
    It remains to make sure that access to the 69 UDP port is allowed, and you can use the delights of a network installation.

    As a bonus, I am attaching a menu that I got as a result of several days of bullying:
    In the current configuration, it is possible to install several OSs (Debian installation is possible both in text and in graphical mode), boot xUbuntu (via nfs), SystemRescueCD (via http-boot), memtest86 (via tftp). Installation of all OSs is possible for 2 architectures - x86 and x64. Because I have an intranet mirror of the Ubuntu 8.10 and Debian 5.0 repositories, then the installers do not offer a choice of a repository, but automatically merge everything from it.
    Screenshots: the
    start screen , after pressing the button , the distribution selection menu , the second part of the distribution selection menu , the installation of Ubuntu , Debian , Fedora , SuSE is selected .
    Archive/ var / lib / tftpboot (nearly 200mb), as well as configuration files for the Ubuntu and Debian installers: they contain repositories + Ubuntu is divided into Ubuntu, kUbuntu, xUbuntu, edUbuntu.
    There is one big minus in this configuration, which I am too lazy to fix: when I open the menu, about 70 files are loaded, most of which the user does not need. To get rid of this, the display of the submenu needs to be transferred from the connection of the menu by inclusions to their call through the vesamenu.c32 kernel , which comes with pxeboot. Also - it doesn’t hurt to clear duplicate menu directories - most of the configs for the x64 and x86 menus are the same.

    Also popular now: