How to configure PXE Network Boot Server for Ubuntu 18.04 Desktop

Опубликовано: 02 Сентябрь 2019
на канале: Heikki Koivisto
14,566
like

I found a lot guides for Ubuntu Server pxe installation. So i made my guide for How to configure PXE Network Boot Server for Ubuntu 18.04 Desktop. I Create server which can provide tool for installing Desktop Ubuntu 16.04/18.04 and preseed file for it.
Support channel: https://www.youtube.com/c/HeikkiKoivi...
Commands:
Install dhcp/tftp server and apache2
apt update && sudo apt install -y dnsmasq apache2
move dnsmasq conf
mv -v /etc/dnsmasq.conf /etc/dnsmasq.conf.backup

edit dnsmasq file
nano /etc/dnsmasq.conf

interface=enp0s3 #enp0s8
bind-interfaces
domain=koti.local

dhcp-range=ens38,192.168.100.100,192.168.100.240,255.255.255.0,8h
dhcp-option=option:router,192.168.100.1
dhcp-option=option:dns-server,192.168.100.1
dhcp-option=option:dns-server,8.8.8.8

enable-tftp
tftp-root=/netboot/tftp
dhcp-boot=pxelinux.0,linuxhint-s20,192.168.100.11
pxe-prompt="Press F8 for PXE Network boot.", 2
pxe-service=x86PC, "Install OS via PXE",pxelinux

create tftp folder:
mkdir -p /netboot/tftp

restart dnsmasq
systemctl restart dnsmasq

install nfs server
apt install -y nfs-kernel-server

create forder for nfs share
mkdir /netboot/nfs

edit nfs share settings:
nano /etc/exports

/netboot/nfs *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,no_subtree_check)

make share available
exportfs -a

install required pxe boot files:
apt install -y syslinux pxelinux

copy pxelinux and other - files to tftp folder
cp /usr/lib/PXELINUX/pxelinux.0 /netboot/tftp/
cp /usr/lib/syslinux/modules/bios/{ldlinux.c32,libcom32.c32,libutil.c32,vesamenu.c32} /netboot/tftp

create pxelinux.cfg folder for boot menu file
mkdir /netboot/tftp/pxelinux.cfg
touch /netboot/tftp/pxelinux.cfg/default

Copy Ubuntu 1804 desktop iso
winscp or wget iso - file

mount iso to mnt
mount -o loop ubuntu-18.04.2-desktop-amd64.iso /mnt

create folders and copy files on it
mkdir -v /netboot/{nfs,tftp}/ubuntu1804
cp -Rf /mnt/* /netboot/nfs/ubuntu1804/
cp -rf /mnt/casper/* /netboot/tftp/ubuntu1804
mkdir /netboot/tftp/ubuntu1804/casper/
cp -rf /mnt/casper/* /netboot/tftp/ubuntu1804/casper/

change permission to /netboot
chmod -Rf 777 /netboot

create boot menu:
nano /netboot/tftp/pxelinux.cfg/default

default vesamenu.c32

label install1
menu label ^Install Ubuntu 18.04 LTS Desktop
menu default
kernel ubuntu1804/casper/vmlinuz
append initrd=ubuntu1804/caspter/initrd boot=casper automatic-ubiquity netboot=nfs nfsroot=192.168.100.11:/netboot/nfs/ubuntu1804/ auto=true url=http://192.168.100.11/local-sources.seed quiet splash toram ---

restart nfs secatrver
/etc/init.d/nfs-kernel-server restart

nano /var/www/html/local-sources.seed

ubiquity ubiquity/summary

Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
d-i debconf debconf/frontend select Noninteractive

Localization
d-i debian-installer/locale string en_GB

Keyboard selection
d-i console-setup/ask_detect boolean false
d-i console-setup/layout select us
d-i console-setup/variant select us

ubiquity languagechooser/language-name select English (US)
ubiquity countrychooser/shortlist select FI
ubiquity keyboard-configuration/layoutcode select fi
ubiquity keyboard-configuration/modelcode select pc105
ubiquity localechooser/supported-locales multiselect en_US.UTF8
ubiquity console-keymaps-at/keymap select fi
ubiquity console-keymaps-at/variant select fi

d-i kbd-chooser/method select British English

Network
d-i netcfg/get_hostname string de-vm
d-i netcfg/get_domain string unassigned-domain

Clock and time zone setup
d-i time/zone string Europe/Helsinki
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true

Partitioning
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

Account setup
d-i passwd/user-fullname string de
d-i passwd/username string de
d-i passwd/user-password password 123
d-i passwd/user-password-again password 123
d-i passwd/auto-login boolean true
d-i user-setup/encrypt-home boolean false
d-i user-setup/allow-password-weak boolean true

Package installation

Enable extras.ubuntu.com.
d-i apt-setup/extras boolean true
Install the Ubuntu desktop.
tasksel tasksel/first multiselect ubuntu-desktop,standard

choose-mirror-bin mirror/http/proxy string

#For the update
d-i pkgsel/update-policy select none
d-i pkgsel/install-language-support boolean false

Bootloader
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

Reboot after preseeding
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/reboot boolean true
#ubiquity ubiquity/poweroff boolean true



missing steps:
mkdir /netboot/tftp/casper/
cp /netboot/nfs/ubuntu1804/casper/* /netboot/tftp/casper/