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.

root@host:~# apt-get install isc-dhcp-server tftpd-hpa pxelinux nfs-kernel-server

dhcp

/etc/dhcp/dhcpd.conf

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

/etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/var/lib/tftpboot"
#TFTP_ADDRESS="[::]:69"
TFTP_ADDRESS="192.168.2.40:69"
TFTP_OPTIONS="--secure"

nfs

/etc/exports

/var/lib/tftpboot/16.10 *(async,no_root_squash,no_subtree_check,ro)

ISO

Download

Download and mount Desktop 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

/var/lib/tftpboot/pxelinux.cfg/default

DEFAULT menu.c32
MENU MARGIN 0
MENU ROWS -9
MENU TABMSG
MENU TABMSGROW -3
MENU CMDLINEROW -3
MENU HELPMSGROW -4
MENU HELPMSGENDROW -1
MENU COLOR SCREEN 30;47
MENU COLOR BORDER 30;47
MENU COLOR TITLE 30;47
MENU COLOR SCROLLBAR 30;47
MENU COLOR SEL 37;40
MENU COLOR UNSEL 30;47
MENU COLOR CMDMARK 30;47
MENU COLOR CMDLINE 30;47
MENU COLOR TABMSG 37;40
MENU COLOR DISABLED 37;40
MENU COLOR HELP 37;40
MENU 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

ISO

Download and mount Alternate ISO file

Download

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/

Source : https://doc.ubuntu-fr.org/netboot_live

Licence Creative Commons
This website http://shebangthedolphins.net is licensed to the public under a licence Creative Commons Attribution licence.
Contact :