Installing Ubuntu via PXE

Problem:
I am trying to PXE boot Ubuntu 18/20, but I cant seem to make much progress. I have been using Foreman for CentOS/RHEL PXE install for many years now and that works without any issues. We usually boot the machine into the PXE menu and manually select the OS we want to install (and the KS file takes over from there).
I am trying to achieve something similar with Ubuntu.

Expected outcome:
Select ubuntu in the PXe menu, installation starts and grabs the preseed file and OS is deployed.

Foreman and Proxy versions:
1.14.3

Other relevant data:
I did the exact same things that I usually do when a new RHEl/CentOS is released.

  • Downloaded ubuntu iso 18 and 20, desktop and server edition, extracted the ISO and have a URL
    pointing to the extracted files.
  • Created a Installation medium using the above http URL
  • Created a OS pointing to the above medium
  • Created hostgroup with the above OS
  • Associated the Ubuntu images with preseed and pxelinux global default (also tried preseed pxelinux default)
  • Build PXE default

When the machine boots into PXE, I see that the menu does display the Ubuntu option. Now some of the issues I encounter

  1. Selecting the Ubuntu option, did nothing, it would put me back to the PXE menu screen.
  • I checked that the linux and initd.gz file in /var/lib/tftpboot/boot folder are both empty. Not sure why. Since I couldnt figure that out after looking at a few things, I manually copied over the linux and initrd file to this location. This allowed me to get past the PXE menu and it started loading the files.
  1. Now it appears that it never gets to the KS/preseed file? I see an error:
    /init: line 49: can’t open /dev/sr0: No medium found
    It tries this several times and finally gives up and asks me if I want to attempt interactive netboot from a URL. If I say yes, and supply the web url to the ISO (not the extracted file) it boots the live image…

So I guess, I am missing something which will autoload the image and the preseed file. or may be Ubuntu works differently than RHEL? We dont have any Ubuntu machines, so I am not very familiar with it unlike RHEL which works just fine with the process that I outlined above.

Any help/pointers would be really helpful. Please let me know if I can provide any logs…

Oh, one more thing, when I build the PXE menu , I see these errors in proxy.log (its weird because I dont have a folder called 20_amd64_s_U04, The folder I have is 20_x86_64_s_U04.

[2020-08-17T15:55:04.524970 ] ERROR -- : [38670] http://webserver.domain.com/os_images/ubuntu/20_amd64_c_U04/dists/focal/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/initrd.gz:

E, [2020-08-17T15:55:04.525071 ] ERROR -- : [38670] 2020-08-17 15:55:04 ERROR 404: Not Found.

I, [2020-08-17T15:55:04.535971 ]  INFO -- : 10.52.194.107 - - [17/Aug/2020:15:55:04 -0700] "POST /tftp/fetch_boot_file HTTP/1.1" 200 - 0.0009

E, [2020-08-17T15:55:04.544263 ] ERROR -- : [38677] http://webserver.domain.com/os_images/ubuntu/20_amd64_s_U04/dists/focal/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64/linux:

E, [2020-08-17T15:55:04.544403 ] ERROR -- : [38677] 2020-08-17 15:55:04 ERROR 404: Not Found.

Thanks,
PK

PS: I created a second support topic within minutes, because the first time I accidentally submitted the request and then it wouldn’t allow me to edit the post to add details.

This is an ancient foreman version (over 3 years old) which does not support ubuntu 20 provisioning. Please upgrade to a recent version (currently supported version is 2.1) and try again.

Thanks @tbrisker. I have a DEV setup on which I can give it a try.

Would it work for older version of Ubuntu though? 16.x?

I am trying to understand if there was something that I missed or mis-configured.

Thanks,
PK

When new host is created, TFTP or HTTP Boot smartproxy is given two URLs (kernel, initramdisk) which are then downloaded via wget. If that fails, zero-sized files are left and an error message appears in the proxy.log. The URL is likely a problem, for Ubuntu/Debian systems you need to make sure the proper “Release Name” name is filled in because that is actually used in the URL itself.

Find those URLs in the proxy.log, try to download them manually and see if that’s 404 or something else.

Thanks for that suggestion. I did check my proxy.log and turns out it was trying to grab the files from a location which didn’t really exist on the 16.x/18.x iso.

I was able to get around it by tweaking a couple of things:

  1. I changed debian.rb from
    'dists/$release/main/installer-$arch/current/images/netboot/' + guess_os + '-installer/$arch'
    to
    'install/netboot/' + guess_os + '-installer/$arch'

  2. In the same file, “x86_64” gets substituted as “amd64”. It so happens that I use x86_64 in my directory naming conventions for RHEL/CentOS which I also used for Ubuntu, and it was getting replaced by amd64 and foreman could never wget the file even after #1 above. So I created another folder with amd64 as the name and symlinked it.

#1 and #2 helped with the linux and initrd.gz file issue and I was able to get past the errors and start the automated pxe boot.

Things work fine if I use archive.ubuntu.com and /ubuntu as my source, but ideally I want to use the local server edition ISO that I downloaded and replace archive.ubuntu.com with my webserver.exmaple.com and point to the correct location.
This doesn’t seem to work. The installation starts, it copies the Release and the Packages.xz file into /tmp/ folder and just sits there and doesnt proceed.

If you have any suggestions to get past this, please let me know. May be I need to download something in addition to the regular ubuntu server ISO?

Thanks,
PK

We don’t support that. Please use the official debian/ubuntu mirror tool to copy content, not ISO. They are different. Ideally install Katello plugin and synchronize repositories using Pulp.

Thanks @lzap

Trying to sync the content/repo using type “deb” .
Upstream URL: http://archive.ubuntu.com/ubuntu/
Releases: xenial/bionic/focal (tried all three, one at a time)
Architecture: amd64
This is on a second foreman server that I have and running version 2.0

Keep running into this error now:

"[Errno 2] No such file or directory: u'/var/cache/pulp/reserved_resource_worker-4@foreman.exmaple.com/ef18e92f-e635-459a-8c9d-d7af2ba4a410/packages/06/8e/libxcb-composite0-dbg_1.11.1-1ubuntu1_amd64.deb'",
      "sub_errors"=>[]},

It appears that something is getting downloaded, because I see /var/cache/pulp disk usage going up during the sync, but then eventually the sync errors out and there are 0 deb packages downloaded.

Just FYI, changing the debian.rb as mentioned above and using archive.ubuntu.com as the source works fine for Ubuntu 16,18 and 20 and Foreman 1.14 in case someone is in a similar situation and is OK using an external source for their installs.

For syncing issue, I suggest you to open up a new properly titled thread. I am not strong in the content area. In other words, I have no clue what is going on :slight_smile:

I was able to get past the sync issue.

I edited the /usr/lib/python2.7/site-packages/nectar/config.py file and changed the read_timeout from 27 to 600. That fixed the sync issue for me.

Now I will try to use this local downloaded copy as per your previous suggestion and see if I can make it work (still syncing the huge universal component).