See PXE Setup for overall PXE instructions. This is Ubuntu specific.

Proxying Debian/Ubuntu repositories

On the server,

apt install apt-cacher-ng
systemctl status apt-cacher-ng
cd /etc/apt-cacher-ng
cp -pi acng.conf acng.conf.dist
egrep '^CacheDir|^LogDir' acng.conf
netstat -antupe --inet --inet6 | grep 3142
#lynx localhost:3142

then after some time you may,

du -sh /var/cache/apt-cacher-ng

On the clients (incl. the server itself),

vi /etc/apt/apt.conf.d/02proxy

Acquire::http { Proxy "http://x.x.x.x:3142"; };

apt update

Refs.

Setting up the network boot

Note: I was not able to use the copied ISO image content as a repository (is it even supposed to work with the latest Ubuntu versions 16,17?), so I used apt-cache-ng as a proxy against the official repository.

dist=artful # 17.10
mkdir /var/lib/tftpboot/$dist/
cd /var/lib/tftpboot/$dist/

wget http://ru.archive.ubuntu.com/ubuntu/dists/artful/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux
wget http://ru.archive.ubuntu.com/ubuntu/dists/artful/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz

unset dist

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

label Ubuntu Server artful (17.10)
kernel artful/linux
append initrd=artful/initrd.gz
# vga=788
# DOES NOT WORK
# url --url http://ru.archive.ubuntu.com/ubuntu/dists/artful http_proxy="http://10.8.8.1:3142"

Adding the Kickstart feature,

DRAFT -- NOT WORKING YET

cd /var/lib/tftpoot/
vi artful.ks

install
url --url http://ru.archive.ubuntu.com/ubuntu/dists/artful http_proxy="http://10.8.8.1:3142
...

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

append ks=http://10.8.8.1/artful.ks

REFERENCES

TRASH / OBSOLETE

cd /var/lib/tftpboot/
mkdir lala/
#mount -o loop path/to/ubuntu-16.04.3-server-amd64.iso lala
mount -o loop path/to/ubuntu-17.10-server-amd64.iso lala
#cp -r lala/ ubuntu1604/
cp -r lala/ ubuntu1710/
umount lala
rmdir lala

label Ubuntu Server artful (17.10)
kernel ubuntu1710/install/netboot/ubuntu-installer/amd64/linux
append initrd=ubuntu1710/install/netboot/ubuntu-installer/amd64/initrd.gz vga=788 url --url http://10.8.8.1/ubuntu1710/

label Ubuntu Server 16.04
kernel ubuntu1604/install/netboot/ubuntu-installer/amd64/linux
append initrd=ubuntu1604/install/netboot/ubuntu-installer/amd64/initrd.gz vga=788 url --url http://10.8.8.1/ubuntu1604/