rss logo

How To : Install Lubuntu via PXE Boot

Configuration

Intro

I wanted to install Lubuntu on a old laptop which has a broken cdrom drive and which is not able to boot on a USB key. So I decided to install it with PXE.

Network diagram

We need one server (I simply booted on a Lubuntu Live CD on a basic computer) and a Internet access (for alternate ISO install).

PXE Server

Installing

We need to install three different services.

  • nfs : distributed file system protocol
  • dhcp : Dynamic Host Configuration Protocol
  • tftp : Trivial File Transfer Protocol
root@host:~# apt-get install isc-dhcp-server tftpd-hpa pxelinux nfs-kernel-server

dhcp

  • Edit /etc/dhcp/dhcpd.conf file :
ddns-update-style none; option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org; default-lease-time 600; max-lease-time 7200; log-facility local7; subnet 192.168.10.0 netmask 255.255.255.0 { range 192.168.10.100 192.168.10.200; option routers 192.168.10.254; option domain-name-servers 192.168.10.254; filename "pxelinux.0"; }

tftp

  • Edit /etc/default/tftpd-hpa file :
TFTP_USERNAME="tftp" TFTP_DIRECTORY="/var/lib/tftpboot" #TFTP_ADDRESS="[::]:69" TFTP_ADDRESS="192.168.10.40:69" TFTP_OPTIONS="--secure"

nfs

  • Edit /etc/exports file :
/var/lib/tftpboot/16.10 *(async,no_root_squash,no_subtree_check,ro)

ISO

Download iso file.

  • Once downloaded, mount ISO file :
root@host:~# mkdir /var/lib/tftpboot/16.10/; mount -t iso9660 lubuntu-16.10-desktop-i386.iso /var/lib/tftpboot/16.10/

boot menu

  • Edit /var/lib/tftpboot/pxelinux.cfg/default file :
DEFAULT menu.c32 ENU MARGIN 0 ENU ROWS -9 ENU TABMSG ENU TABMSGROW -3 ENU CMDLINEROW -3 ENU HELPMSGROW -4 ENU HELPMSGENDROW -1 ENU COLOR SCREEN 30;47 ENU COLOR BORDER 30;47 ENU COLOR TITLE 30;47 ENU COLOR SCROLLBAR 30;47 ENU COLOR SEL 37;40 ENU COLOR UNSEL 30;47 ENU COLOR CMDMARK 30;47 ENU COLOR CMDLINE 30;47 ENU COLOR TABMSG 37;40 ENU COLOR DISABLED 37;40 ENU COLOR HELP 37;40 ENU TITLE Ubuntu Live LABEL 1 Ubuntu Live KERNEL 16.10/casper/vmlinuz APPEND boot=casper rootfstype=nfs netboot=nfs nfsroot=192.168.10.40:/var/lib/tftpboot/16.10 debian-installer/language=fr console-setup/layoutcode=fr console-setup/variantcode=oss quiet splash initrd=16.10/casper/initrd.lz --
  • Copy files :
root@host:~# cp /var/lib/tftpboot/16.10/isolinux/ldlinux.c32 /var/lib/tftpboot/ root@host:~# cp /var/lib/tftpboot/16.10/isolinux/libutil.c32 /var/lib/tftpboot/ root@host:~# cp /usr/lib/syslinux/modules/bios/menu.c32 /var/lib/tftpboot/ root@host:~# cp /usr/lib/PXELINUX/pxelinux.0 /var/lib/tftpboot/
  • Restart Services :
root@host:~# service isc-dhcp-server restart; service nfs-kernel-server restart; service tftpd-hpa restart

If you have less than 700M RAM

If like me, you have less than 700M RAM, your computer will freeze during the install, so you need to use the alternate ISO.

  • Download and mount Alternate ISO file :

Download ISO file.

Note : it seems that Alternate iso is now deprecated. root@host:~# mkdir /var/lib/tftpboot/16.10/; mount -t iso9660 lubuntu-16.10-alternate-i386.iso /var/lib/tftpboot/16.10/
  • Copy files :
root@host:~# cat /var/lib/tftpboot/16.10/install/netboot/ubuntu-installer/i386/pxelinux.cfg/default > /var/lib/tftpboot/pxelinux.cfg/default root@host:~# cp -a /var/lib/tftpboot/16.10/install/netboot/ubuntu-installer /var/lib/tftpboot/ root@host:~# cp /var/lib/tftpboot/16.10/install/netboot/ubuntu-installer/i386/boot-screens/ldlinux.c32 /var/lib/tftpboot/ root@host:~# cp /var/lib/tftpboot/16.10/install/netboot/ubuntu-installer/i386/pxelinux.0 /var/lib/tftpboot/

Sources :

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address