Is Ubuntu 22.04 supported with any version of Foreman yet?

Hi @rgp
Thanks for your feedback.

I’ve added the dependency and tested it in a container:

# docker run --rm -it ubuntu:jammy

root@7ca3590c44ff:/# history
    1  apt-get update && apt-get install gpg wget
    2  wget
    3  apt-key add
    4  echo "deb stable main" >> /etc/apt/sources.list
    5  apt-get update && apt-get install subscription-manager

root@7ca3590c44ff:/# apt-cache rdepends apt-transport-katello
Reverse Depends:
1 Like

Hey @dankowsk!
Foreman Smart Proxy doesn’t deliver the user-data templates because they are not available on the proxy (good point tho, would be nice if the proxy would have this capability). Therefore, it just forwards /userdata/ requests to the corresponding Foreman API. But, in order for this to work flawlessly, you gotta open port 8000 on the proxy and configure http forwarding as described in the orcharhino doc here.

Moreover, pay attention to your PXELinux template to reference the Proxy endpoint correctly. You have to use port 8000 on the Proxy, such that it forwards the request to your Foreman. The rendered template should look somehow like the following:

DEFAULT linux cloud-init autoinstall
LABEL linux cloud-init autoinstall
    KERNEL boot/ubuntu-22-04-DGjUR6nWp6Ze-vmlinuz
    INITRD boot/ubuntu-22-04-DGjUR6nWp6Ze-initrd
    APPEND url= autoinstall ds=nocloud-net;s= root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip cloud-config-url=/dev/null ip=dhcp locale=en_US

I would also recommend to put the iso image itself on the Smart Proxy as you can see in the url part (in case your host may not be able to communicate with your Foreman directly).
Keep in mind - this is only important if you wanna deploy via a Smart Proxy which may have a different subnet. If your host is directly connected to your Foreman, you don’t need to use port 8000 of your proxy since it can use the Foreman directly instead.

Let me know if this helps or if you have more questions!

@LeperMessiah what Foreman version are you referring to? Did you setup the userdata template and associate it with your operating system?

I would like to install Ubuntu 22.04 via Foreman as well.

Have a look at this discussion (especially at the end). It may help you too @ryle249.

1 Like

Hi @bastian-src !

Thanks, I think that was the missing point. I was aware of opening port 8000, I missed the rest. :wink:

1 Like

Hey @gol19!
You’re correct about the hardcoded debian part. Foreman 3.3 is not able to find the files in the Installation Media. Only with the latest foreman, there comes an exception for Ubuntu 22.04 which looks in the casper directory of the extracted image. You can solve this issue by creating a symbolic link accordingly.

The address you are referring is just an example: is not a real address. Your pub directory should already be available at if that’s the IP of your Foreman. If it is not available, you sould also run into problems on other operating systems since they install the katello certificates from here. So, you gotta fix that first.

Is there a how-to with all the necessary steps to solve this problem?
I don’t get it. If I open Index of /ubuntu/dists/jammy/main/installer-amd64
I can’t find the new installer there is only a subfolder /legacy-images/ which is empty.


You can find all necessary steps with Foreman 3.4 documented here. In case you want to provision an Ubuntu 20.04.3+ host via a Smart Proxy, also pay attention to this.

In case you need more specific help, let me know!

Ok, I download the ISO image and extracted it.


drwxr-xr-x. 8 root root   135 Nov 24 11:52 ./
drwxr-xr-x. 3 root root    50 Nov 24 11:52 ../
dr-xr-xr-x. 3 root root    40 Apr 15  2022 boot/
-r--r--r--. 1 root root  2048 Aug  9 16:48 boot.catalog
dr-xr-xr-x. 2 root root  4096 Aug  9 16:48 casper/
dr-xr-xr-x. 3 root root    49 Aug  9 16:48 dists/
dr-xr-xr-x. 3 root root    18 Apr 15  2022 EFI/
dr-xr-xr-x. 2 root root     6 Aug  9 16:48 install/
-r--r--r--. 1 root root 11408 Aug  9 16:48 md5sum.txt
dr-xr-xr-x. 4 root root    36 Aug  9 16:48 pool/
lrwxrwxrwx. 1 root root     1 Aug  9 16:48 ubuntu -> ./

But I guess
/usr/share/foreman/app/models/operatingsystems/debian.rb has to be adapted as well

    if (guess_os == 'ubuntu' && major.to_i >= 20)
      'dists/$release/main/installer-$arch/current/legacy-images/netboot/' + guess_os + '-installer/$arch'
      'dists/$release/main/installer-$arch/current/images/netboot/' + guess_os + '-installer/$arch'

this one will not work.

It seems like you are not on Foreman 3.4. If you want Foreman to identify the boot files of Ubuntu 20.04.3+ images (so, including 22.04 and everything newer), you must include the changes in this commit:

Moreover, you should have a look at the provisioning templates. Especially the following two are important for Ubuntu 20.04.3+ deployment and must be associated in your Operating System configuration.

1 Like

I can not update to 3.4 as EL7 support is dropped with Foreman 3.4 :frowning:
(This problem should be solved at another time)

I switched the /usr/share/foreman/app/models/operatingsystems/debian.rb with your version from GitHub. :+1:
Then I added the preseed_default_pxelinux file you mentioned above.
But the VM will not start the installer the last step is:

HTTP://<hostname>/unattended/iPXE... ok

vsphere is complaining that VM is consuming too many CPU resources

In the template, I replaced the variables (KERNEL, INITRD, APPEND) with static values to make sure everything is fine. Then I downloaded the iso image, initrd and vmlinux manually.
All 3 links are working fine. Any idea what is missing?

Alright, reasonable. :+1: The debian.rb file change should be the most important commit for Ubuntu Autoinstall in Foreman 3.4.

It seems like your host tries to download the wrong boot template (it should use the previously mentioned PXELinux instead of some iPXE). What does your Operating System configuration in Foreman look like? Did you associate the template as I mentioned previously?

Can you maybe also provide a rendered version of your PXELinux template? After applying the commit, you shouldn’t adapt the KERNEL and INITRD paths anymore because Foreman detects them now. It recognizes the boot files in your installation media (in the /casper/) folder and downloads them to /var/lib/tftpboot/boot/<ubuntu-22-04-and-some-hash-code>-[initrd|vmlinuz]. The files might exist already from a previous run and you must delete them manually - otherwise, Foreman does not re-download them.

Just to be sure, we want to mount the image into VMware.
I thought that would be rather iPXE than good old PXE.

Anyhow, I change the template from iPXE to PXE.
For testing purposes, I removed all other templates. So it looks like that now:

This is the rendered template:

# This file was deployed via 'Preseed PXE 22.04' template
# Supported host/hostgroup parameters:
# blacklist = module1, module2
#   Blacklisted kernel modules
# lang = en_US
#   System locale
# Foreman will not download the kernel/initramdisk to PXE automatically. Please follow
# the official Ubuntu documentation and extract the files from the LiveCD (DVD) manually
# and optionally update the KERNEL and INITRD lines in this template.
DEFAULT linux cloud-init autoinstall
LABEL linux cloud-init autoinstall
    KERNEL boot/ubuntu-local-repo-kddGAsOXrj4S-vmlinuz
    INITRD boot/ubuntu-local-repo-kddGAsOXrj4S-initrd
    APPEND ip=dhcp url=http://<MYPUPPETSERVER>/pub/installation_media/ubuntu/22.04-x86_64.iso autoinstall root=/dev/ram0 ramdisk_size=1500000 fsck.mode=skip

I checked /var/lib/tftpboot/boot/ but both files:

  • ubuntu-local-repo-kddGAsOXrj4S-vmlinuz
  • ubuntu-local-repo-kddGAsOXrj4S-initrd
    are missing.

I gotta admit, I didn’t use iPXE before and just PXELinux or PXEGrub2.
Is there any difference when you deploy the machine now? Is it still looking for iPXE?

Since your boot files are missing, I assume Foreman runs into an error when extracting these. Does the corresponding Installation Media point to your http://<MYPUPPETSERVER>/pub/installation_media/ubuntu/22.04-x86_64?

Did you check /var/log/foreman/production.log? When you deploy your machine (e.g. click Build in foreman), there should appear some messages like the following:

<log time> Deploying TFTP PXELinux configuration for <host fqdn>
<log time> Skipping TFTP PXEGrub2 configuration for <host fqdn>
<log time> Skipping TFTP PXEGrub configuration for <host fqdn>
<log time> Skipping TFTP iPXE configuration for <host fqdn>
<log time> Fetching required TFTP boot files for <host fqdn>

At the time of the last command, there should also be something like this in your Smart Proxy (/var/log/foreman-proxy/proxy.log):

<log time> Started POST /tftp/fetch_boot_file
<log time> Started task /usr/bin/curl ... <installatio media path> ... </var/lib/tftpboot/boot/ubuntu-local-repo-kddGAsOXrj4S-vmlinuz>
<log time> Finished POST /tftp/fetch_boot_file

Regarding your template: It looks fine, despite the fact that you are missing this part from the original one (which I assume you left out on purpose for debugging). Without this, your machine is probably going to run into an error later on when the installer is actually booted - but let’s see when we get there :crossed_fingers:

APPEND .. ds=nocloud-net;s=http://<%= foreman_request_addr %>/userdata/ ..

now I receive the following error

HTTP://<MYPUPPETSERVER>unattended/iPXE... No such file or diectory

Yes, the directory
exists and I am able to download the iso with Firefox.

These are the lines from the log file

2022-11-29T10:18:48 [I|app|2f67287d] Started GET "/hosts/mynewhost.mydomain/review_before_build" for at 2022-11-29 10:18:48 +0000
2022-11-29T10:18:48 [I|app|2f67287d]   Parameters: {"id"=>"mynewhost.mydomain"}
2022-11-29T10:18:51 [I|app|bd0d5371] Started PUT "/hosts/mynewhost.mydomain/setBuild?auth_object=mynewhost.mydomain&permission=build_hosts" for at 2022-11-29 10:18:51 +0000
2022-11-29T10:18:51 [I|app|bd0d5371]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"NLxHAZO52h+9rns0ZGLR59v5KeAbQODbf0x50LpTY6ZBDFWUb3tLPfG2/oRJSYdzLUSF6obyYXwPbHpC29C/eA==", "host"=>{"build"=>"0"}, "commit"=>"Build", "auth_object"=>"mynewhost.mydomain", "permission"=>"build_hosts", "id"=>"mynewhost.mydomain"}
2022-11-29T10:18:51 [I|app|bd0d5371] Generating HOST ISO image for mynewhost.mydomain
2022-11-29T10:18:52 [I|app|bd0d5371] Uploading ISO image /tmp/d20221129-32435-2p4kkg/mynewhost.mydomain.iso for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Deploying TFTP PXELinux configuration for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Skipping TFTP PXEGrub2 configuration for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Skipping TFTP PXEGrub configuration for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Skipping TFTP iPXE configuration for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Fetching required TFTP boot files for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Attaching ISO image to CDROM drive for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Delete the autosign entry for mynewhost.mydomain
2022-11-29T10:18:54 [I|app|bd0d5371] Remove puppet certificate for mynewhost.mydomain
2022-11-29T10:18:55 [I|app|bd0d5371] Adding autosign entry for mynewhost.mydomain
2022-11-29T10:18:55 [I|app|bd0d5371] Redirected to https://<MYPUPPETSERVER>/hosts/mynewhost.mydomain
2022-11-29T10:18:55 [I|app|3676db99] Started GET "/hosts/mynewhost.mydomain" for at 2022-11-29 10:18:55 +0000
2022-11-29T10:18:55 [I|app|3676db99]   Parameters: {"id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|8351e5a2] Started GET "/hosts/mynewhost.mydomain/runtime?range=7" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|8351e5a2]   Parameters: {"range"=>"7", "id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|bd279e09] Started GET "/hosts/mynewhost.mydomain/vm" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|ba4e2a67] Started GET "/hosts/mynewhost.mydomain/templates" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|8858b597] Started GET "/hosts/mynewhost.mydomain/overview" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|c824d9af] Started GET "/hosts/mynewhost.mydomain/nics" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|bfb08f45] Started GET "/hosts/mynewhost.mydomain/resources?range=7" for at 2022-11-29 10:18:56 +0000
2022-11-29T10:18:56 [I|app|bd279e09]   Parameters: {"id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|ba4e2a67]   Parameters: {"id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|bfb08f45]   Parameters: {"range"=>"7", "id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|8858b597]   Parameters: {"id"=>"mynewhost.mydomain"}
2022-11-29T10:18:56 [I|app|c824d9af]   Parameters: {"id"=>"mynewhost.mydomain"}

I just removed

ds=nocloud-net;s=http://<%= foreman_request_addr %>/userdata/

to reduce it to the basic setup. If I am able to boot 22.04 I will add it again

It’s weird to me that Foreman is still looking for an iPXE even tho you only set the PXELinux template. Especially, because the log you posted mentions that it deploys PXELinux and skips iPXE.

Can you also provide the Smart Proxy log (/var/log/foreman-proxy/proxy.log)? Did it contain the message I mentioned here?

Commenting on this:

Ok, so the directory exists, but does your Installation Media also contain that path? You should have an installation media configured like this:

And this must then be set in your Operating System configuration. According to this, your boot files are fetched and put in the corresponding tftpboot folder mentioned earlier.

Another think regarding the iPXE just came into my mind: When you deploy your host, do you set the PXE loader to PXELinux BIOS? It is in the Operating System tab.

The Installation Media is set on this page as well and must be the one I mentioned earlier (pointing to your local extracted iso in your pub directory)

@bastian-src sorry for the delay.
In this network is no DHCP relay/server available. I am not sure if we can use pxe in this case.
Nevertheless, I changed the PXE loader from ‘none’ to ‘PXELinux BIOS’

Now I am receiving the following error:

HTTP://<MYPUPPETSERVER>/unattended/iPXE... No such file or directory.


2022-12-06T10:39:25 8edda413 [I] Started POST /puppet/ca/autosign/<myhost>
2022-12-06T10:39:25 8edda413 [I] Finished POST /puppet/ca/autosign/<myhost> with 200 (0.63 ms)

No worries regarding the delay, I do also need some time! :slight_smile:
Your Installation Media path is configured wrong. As described in the docs here: Provisioning Hosts, it says

Use to set up your installation media entry in Foreman.

Accordingly, you should have the iso image here http://<MYSERVER>/pub/installation_media/ubuntu/22.04-x86_64.iso (as you mentioned you already did this) and the extracted image right next to it here http://<MYSERVER>/pub/installation_media/ubuntu/22.04-x86_64/.
The Installation Media path must point to the extracted folder, not just it’s parent [...]/ubuntu as it is currently the case in your configuration.

I’m not sure about using PXE without a DHCP server - so, if you are confident that iPXE sould to the job here - go for it. Just keep in mind to set the autoinstall boot parameters in the iPXE template as well. You should be able to easily “migrate” them from the PXELinux Autoinstall template.

Regarding your proxy log file: The snippet you sent does not contain the API call which is important for the boot file download. Re-run the host deployment with the updated Installation Media path, as I mentioned earlier, check whether the boot files are now downloaded to /var/lib/tftpboot/boot/, and have a look at your Smart Proxy log for a POST request to tftp/fetch_boot_file. It could be interesting to see that.

Where did you get the files initrd and vmlinuz for Ubuntu 22.04? They are not in repository nor on the iso image.

I found them in a folder casper, but they are not working. I am ending at kernel panic.