Skip to main content

Setting up PXE-Booting for Ubuntu 16.04 LTS


This is a follow up on my previous post in which I'm writing on how to set up a pxe-server on CentOS 7.4. But since I do not only want CentOS being pxe-bootable, I'll also add Ubuntu to the mix. So here is what I did to be able to boot Ubuntu 16.04 via pxe:

Setting up the directory for pxe-booting
 [archy@pxe-server ~]$ mkdir /var/lib/tftpboot/ubuntu1604  
Downloading the ubuntu-netboot archive and extract the necessary files to the boot-directory:
 [archy@pxe-server ~]$ wget http://cz.archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/current/images/netboot/netboot.tar.gz  
 [archy@pxe-server ~]$ tar -xzf netboot.tar.gz  
 [archy@pxe-server ~]$ sudo cp ubuntu-installer/amd64/{initrd.gz,linux} /var/lib/tftpboot/ubuntu1604  
Now it's time to edit the pxelinux.cfg/default file. Add the following entry for ubuntu:
 sudo vim /var/lib/tftpboot/pxelinux.cfg/default  

 label 4  
 menu label ^4) Install Ubuntu 16.04  
 kernel ubuntu1604/linux  
 append initrd=ubuntu1604/initrd.gz  
Assuming you've followed my previous guide, your pxe-config should now look like this:
 default menu.c32  
 prompt 0  
 timeout 300  
 ONTIMEOUT  
 menu title ######## PXE Boot Menu ########  
 label 1  
 menu label ^1) Boot from local drive  
 localboot 0x00  
 label 2  
 menu label ^2) Install CentOS 7 using local Repo and kickstart  
 kernel centos7/vmlinuz  
 append initrd=centos7/initrd.img ks=http://web01.archyslife.lan/ks-minimal.cfg inst.stage2=nfs:172.31.10.10:/images/CentOS-1708  
 label 3  
 menu label ^3) Install CentOS 7 using local Repo  
 kernel centos7/vmlinuz  
 append initrd=centos7/initrd.img inst.stage2=nfs:172.31.10.10:/images/CentOS-1708  
 label 4  
 menu label ^4) Install Ubuntu 16.04  
 kernel ubuntu1604/linux  
 append initrd=ubuntu1604/initrd.gz  
You can now start the ubuntu-installer via pxe.

Feel free to comment and / or sugguest a topic.

Comments