Ubuntu – Ubuntu 16.04 pxe server install problem finding live-image

pxeserver

I am attempting to create an Ubuntu 16.04 PXE server to install other server instances.

I have already managed to get a PXE client to start the installation process however it fails at the step "Install the System".

I did a bit of digging and it appears that it could not find the live image to start the installation. I used the proposed fix of adding a preseed
live-installer/net-image=http://192.168.56.2/ubuntu/install/filesystem.squashfs.

This still failed but when I checked the output on tty-4, it seems that it was trying to download the image from /cdromhttp://192.168.56.2... and not at the real URL I gave it. Can anyone verify that I am using the correct preseed value to install a normal server?.

EDIT: actually, the same type of problem appears to be happening here as well:
https://serverfault.com/questions/715162/ubuntu-netboot-installation-crashes

the installer seems to be adding /cdrom to url path provided in live-installer/net-image

Best Answer

Same issue I was facing few days ago. This is a bug reported already in Ubuntu 16.

For workaround you need to edit the file bin/fetch-url located in initrd.gz

steps for editing the file and unpacking again:

1. gunzip initrd.gz
2. cdrom  initrd
3. cpio -id < ../initrd
4. # ls
bin  dev  etc  init  modules proc  sbin  selinux  sys  tmp  var
5. Now edit your file bin/fetch-url
add the following lines before the proto= line near the bottom:
prefix="/cdrom"
url=${url#$prefix}
6. save and close the file.
7. Now pack the directory again-
   find . | cpio --create --format='newc' > /tmp/initrd
8. gzip initrd
9. Now move the file to the specified location where it was actually located.

My issue has been resolved after taking all above steps. I hope this will help you :-)