In this blog we follow on from the previous module were we setup a PXELinux server on Ubuntu 16.04 by extending the configuration to PXE install Ubuntu 16.04. We start of with manual install and later we will revisit the preseed file to auto-install. To make the most of this tutorial you should have a PXE Linux server setup similar to the previous blog we highlighted. By the end of this module you will be able to deploy a manual installation using PXE install Ubuntu 16.04. By booting to the network you will be presented with the normal Ubuntu installation screens for Ubuntu 16.04 LTS. In the next lesson we look at deploying Clonezilla Imaging Software with PXE
Download the Ubuntu Installer for PXE Install Ubuntu 16.04
Firstly, we can download the Ubuntu 16.04 installer. This is compressed file that contains all the files necessary for the PXE Server. As we have an existing PXE Server we just need to use the Ubuntu kernel and RAM disk. To download the file, work within your home directory and run the following command. You will find the download should not take long as the file is about 43MB.
$ wget http://archive.ubuntu.com/ubuntu/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/netboot.tar.gz \ -O 16-04-netboot.tar.gz
Keeping everything tidy we will create a directory and expand the archive into the directory:
$ mkdir ~/16-04-netboot $ tar zxf 16-04-netboot.tar.gz -C ~/16-04-netboot
Copy the Install Kernel and RAM Disk
Having expanded the installed archive we now need to add the boot files to the TFTP Server. As we may install many Linux distributions we will keep these files in their own sub-directory within the root directory for the TFTP Server. For us, this was the directory /tftpboot. The two files we copy are linux, the kernel and initrd.gz the RAM disk. By Enclosing the two files within the brace brackets we can reduce the code to copy.
$ sudo mkdir /tftpboot/1604/ $ sudo cp 16-04-netboot/ubuntu-installer/amd64/{linux,initrd.gz} /tftpboot/1604/
Modify the PXE Configuration
The final task we need to complete is to update the PXE Linux configuration file. The configuration we have so far has not been setup to install Ubuntu, allowing only to boot from the local disk. Adding a new stanza to PXE Install Ubuntu 16.04 will allow the options we need. The file we are editing is the default file. This can be found on out system at /tftpboot/pxelinux.cfg/default. We will append to the original content. The edited the file should read as the following. The additions are shown in orange:
default menu.c32 prompt 0 menu title Boot Menu label localboot menu label Boot Local Disk localboot 0 label 1604manual menu label Manual Install Ubuntu 16.04 Server kernel 1604/linux append initrd=1604/initrd.gz vga=788
Even without going as far as a preseed file we can extend the kernel parameter a little to reduce the questions asked. The first question asked in this next method will be for the installation mirrorsL
default menu.c32
prompt 0
menu title Boot Menu
label localboot
menu label Boot Local Disk
localboot 0
label 1604manual
menu label Manual Install Ubuntu 16.04 Server
kernel 1604/linux
append initrd=1604/initrd.gz vga=788 locale=en_GB.UTF-8 keyboard-configuration/layoutcode=gb hostname=1604
Booting via PXE with this configuration and selecting the install on Ubuntu will take you direct to selecting the mirror location to install from. The video that follows demonstrates this setup.