Obtaining network installation images

The next step in our PXE boot setup process is to build out the images required. Luckily, obtaining the boot images is quite easy—the kernel and packages are normally contained on the DVD ISO images for your chosen Linux distribution. Obviously, this can vary from distribution to distribution, so you will need to check this. In this chapter, we will show examples for Ubuntu Server and CentOS 7—these principles could also be applied to many Debian derivatives, Fedora, and Red Hat Enterprise Linux.

The installation images required for network booting, along with the required installation packages, are normally found on the full DVD images—live images are often not sufficient because they lack either a sufficiently complete set of packages to perform the installation, or the network boot-capable kernel is missing.

Let's make a start with the CentOS 7 image, as follows: 

  1. First of all, download the latest DVD image from your nearest mirror—for example, the one shown in the following code block:
$ wget http://mirror.netweaver.uk/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso
  1. Once downloaded, mount the ISO image to a suitable location so that the files can be copied from it, as follows:
$ mount -o loop CentOS-7-x86_64-DVD-1810.iso /mnt
  1. Now, the network boot-capable kernel and initial RAMDisk image should be copied to a location of our choosing, under the TFTP server root.
Note that in the following example, we are only doing this for UEFI booting. To set up for Legacy BIOS booting, follow exactly the same process, but place all files to be served by TFTP in /var/lib/tftpboot/BIOS instead. This applies throughout the rest of this chapter.

The commands to achieve this on our test system are as follows:

$ mkdir /var/lib/tftpboot/EFIx64/centos7

$ cp /mnt/images/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/EFIx64/centos7/
  1. Finally, we need the web server we installed earlier to serve out the files for the installer—once the kernel and initial RAMDisk environment load, the rest of the environment will be served over HTTP, which is better suited to large data transfers. Again, we'll create a suitable subdirectory for our CentOS content, as follows:
$ mkdir /var/www/html/centos7/

$ cp -r /mnt/* /var/www/html/centos7/

$ umount /mnt

That's all there is to it! Once these steps have been completed, we'll repeat this process for our Ubuntu 18.04 Server boot image, as follows:

$ wget http://cdimage.ubuntu.com/releases/18.04/release/ubuntu-18.04.2-server-amd64.iso

$ mount -o loop ubuntu-18.04.2-server-amd64.iso /mnt

$ mkdir /var/lib/tftpboot/EFIx64/ubuntu1804

$ cp /mnt/install/netboot/ubuntu-installer/amd64/{linux,initrd.gz} /var/lib/tftpboot/EFIx64/ubuntu1804/

$ mkdir /var/www/html/ubuntu1804

$ cp -r /mnt/* /var/www/html/ubuntu1804/

$ umount /mnt

With these steps complete, we just have one more configuration stage to go before we can perform a network boot of our chosen operating system.

The process is almost identical—the only difference is that the NetBoot-capable kernel and RAMDisk were sourced from a different directory on the ISO image.

In the next section, we will configure the PXE boot server we have built so far, so as to boot from these installation images.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset