Ubuntu – Installing 14.04 from ubuntu-14.04-desktop-amd64.iso with pxe

14.0464-bitdebian-installerpxe

We're trying to do an automated network installation using pxe.

We installed netboot tools (14.04 LTS) and extracted the ubuntu-14.04-desktop-amd64.iso contents into http server.
We saw that we have to download missing repository main/debian-installer (about 50MB) which is necessary for netboot installation, but it is not included within the iso distribution file.

Installation process begin, and failed during "Download installer components" phase saying the installer failed to download a file from the mirror.
The question is "Is it possible to add main/debian-installer repository to the original ubuntu-14.04-desktop-amd64.iso contents and how ?". We want to do automatic installation without Internet access.

Best Answer

I consider that you should first create a customized live-dvd of Ubuntu-14.04.

Procedure:

a- Download an official Desktop CD from http://releases.ubuntu.com/ (You already did)

b- Move it into an empty directory.

mkdir ~/livecdtmp
mv ubuntu-14.04-desktop-amd64.iso ~/livecdtmp
cd ~/livecdtmp 

c- Mount and extract the Desktop .iso, and extract the SquashFS filesystem

mkdir mnt
mkdir extract-cd
sudo su
mount -o loop ubuntu-10.04-desktop-amd64.iso mnt
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
unsquashfs mnt/casper/filesystem.squashfs
mv squashfs-root edit
cp /etc/resolv.conf edit/etc/
cp /etc/hosts edit/etc/

d- Prepare and chroot

sudo su
mount --bind /dev/ edit/dev
chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root
export LC_ALL=C
dbus-uuidgen > /var/lib/dbus/machine-id
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl

e- Customize, remove any temporary files and delete temporary files using commands:

sudo su
apt-get install package
apt-get remove --purge package
apt-get clean
apt-get autoremove
rm /etc/hosts
rm /var/lib/dbus/machine-id
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl

f- umount special filesystems and exit chroot

sudo su
umount /proc || umount -lf /proc
umount /sys
umount /dev/pts
exit

g- Producing the CD image

sudo su
chmod +w extract-cd/casper/filesystem.manifest
chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sed -i '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
sed -i '/casper/d' extract-cd/casper/filesystem.manifest-desktop
umount edit/dev
rm extract-cd/casper/filesystem.squashfs
mksquashfs edit extract-cd/casper/filesystem.squashfs -comp xz -e edit/boot
printf $(sudo du -sx --block-size=1 edit | cut -f1) > extract-cd/casper/filesystem.size
nano extract-cd/README.diskdefines
cd extract-cd
rm md5sum.txt
find -type f -print0 | xargs -0 md5sum | grep -v isolinux/boot.cat | tee md5sum.txt
mkisofs -D -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../ubuntu-14.04-desktop-amad64-custom.iso

Source: https://help.ubuntu.com/community/LiveCDCustomization