Is Ubuntu 22.04 supported with any version of Foreman yet?

@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.

/var/log/foreman-proxy/proxy.log

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 http://foreman.example.com/pub/installation_media/ubuntu/22.04-x86_64/ 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.

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

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

Did you have a look at the documentation mentioned here:

In case this doesn’t help, let me know what Foreman version you are using and please provide some information on the templates you are currently using.

I hope this helps :slight_smile:

Hi. We are using Foreman 2.3 on CentOS 7.9. All templates are already created. We are provisioning RHEL6,7,8, CentOS7, OracleLinux8 and Ubuntu 16.04, 18.04 and 20.04. Now I am preparing deployment of Ubuntu 22.04 but the problem is the UEFI boot. I don’t know exactly which boot template to use. I am trying Grub2 UEFI boot (because it works on Oracle Linux 8 with UEFI) with template Preseed default PXEGrub2. We use DHCP from other servers, tftp server on Foreman and apt-mirror created mirror as installation source. The vmlinuz and initrd files are from server image iso, just renamed to linux and compressed to initrd.gz. When I use Foreman provided grubx64.efi, I end in kernel panic, when I use grubx64.efi from iso, it ends in grub console.

The documentation did’t help me a lot because it’t quite generic for this specific problem. All distributions we provide are deployed with legacy boot. The problem is UEFI boot on Ubuntu 22.04.

I just figured out that I can’t overwrite the Foreman provided /var/lib/tftpboot/grub2/grubx64.efi with the one from Ubuntu, because it breaks the UEFI boot of RHEL8 and OracleLinux8

Foreman 2.3 does not have the Autoinstall templates which are necessary for Ubuntu 22.04. Moreover, it does not detect the Installation Media correctly - I’m not sure whether you’re renaming is sufficient in this case. You can verify this by checking your /var/lib/tftpboot/boot/ folder and see whether the Ubuntu 22.04 files match the file size of the vmlinuz and initrd file of the image.

As a boot template, I usually rely on Preseed default PXEGrub2 Autoinstall. In case you need a UEFI-compatible template, the latest Foreman comes also with Preseed default PXEGrub2 Autoinstall. You can find it here: foreman/preseed_default_pxegrub2_autoinstall.erb at develop · theforeman/foreman · GitHub

But, this template uses the foreman_request_addr variabel which is only available since 3.1. So, I embrace you to update your Foreman for actual Ubuntu 22.04 support.

I have installed Foreman 3.5.1 and the template Preseed default PXEGrub2 Autoinstall was not there. I have created it according to the git but it still doesn’t work. Now when the autoinstall is starting I get the error /init: line 49: can’t open /dev/sr0: No medium found. I am using the unpacked iso published by http as installation source. I have absolutely no idea what templates to use or how to set it corretly to make it work. I didn’t find any how to for installing Ubuntu 22.04 from Foreman. I am using these templates - PXEGrub2 template (modified Preseed default PXEGrub2 Autoinstall), Finish template (modified Preseed default finish), Provisioning template (modified Preseed default) and newly i tried also User data template (modified Preseed Autoinstall cloud-init user data)

Hey! I just figured an issue in my answer before - just wanted to say that I rely on Preseed default PXELinux Autoinstall usually. The PXEGrub2 template should work too tho.

Did you also add the snippet preseed_kernel_options_autoinstall?
Preseed default PXEGrub2 Autoinstall relies on it. Here is a link to the snippet:

Can you provide a rendered version of your PXEGrub2 Autoinstall and Preseed Autoinstall cloud-init user data template?

Your choice of templates seems fine, you just don’t need the provisioning template and should use the User data template instead.

One more thing: How much RAM does your host have? For my tests, I need at least 4GB to run Ubuntu (but I assume your error comes up before starting the installer in the first place?).

Hi. Yes I also copied and modified preseed_kernel_options_autoinstall, i just didn’t mention it. Here is the PXEGrub2 template:

set default=0
set timeout=0

menuentry 'Preseed KB Ubuntu 22.04 PXEGrub2' {
    linuxefi boot/ubuntu-22-04-ourlocalrepository-ICDJyO5bXbkA-vmlinuz ramdisk_size=1500000 root=/dev/rd/0 rw auto url=http://ourlocalrepository.com:8000/foreman_isos/ubuntu-22.04-live-server-amd64/ cloud-config-url=/dev/null autoinstall "ds=nocloud-net;s=http://ourforeman.com/userdata/" ["ip=dhcp", "console-setup/ask_detect=false", "localechooser/translation/warn-light=true", "localechooser/translation/warn-severe=true", "hostname=targetserver.com", "domain=com"]
ip=dhcp console-setup/ask_detect=false localechooser/translation/warn-light=true localechooser/translation/warn-severe=true hostname=targetserver.com domain=com
    initrdefi boot/ubuntu-22-04-ourlocalrepository-ICDJyO5bXbkA-initrd
}

I just changed the hostnames because of privacy, it’s a company environment.
The user data template is generic, I just changed the URI to our local mirror of ubuntu repository. Till now we were using the Preseed provision template so all the configuration is there.

Absolutely reasonable.

The error seems to be that your url parameter points to the (I guess) extracted image directory. But, it actually must be the iso image itself here. You can see at this line in the PXEGrub2 Autoinstall template, that it takes the installation media path but changes the folder (which is just used to retrieve the initrd/kernel files) to the .iso image - it is supposed to be placed right next to the extracted folder:

This duality of the extracted and un-extracted installation image is also described in the first link in the Foreman docs mentioned here:

Let me know if this helps!

When I used a path to iso file, I was getting errors from foreman tftp server, which is trying to download kernel and initramdisk at the moment I push the Build button, that it can’t find the file path_to_iso.iso/something. It was treating the iso as a directory. I can try it whole again with the user data template and let you know. But this was the reason I used a directory with extracted iso in the url.

Yep, that makes totally sense: the Installation Media must be a path to the extracted iso image folder such that Foreman can download the initrd/kernel from there. So, you should keep that path pointing to the directory.

But, since Ubuntu needs the iso itself for its new installation process, the PXEGrub2 template must point to the iso image and not the extracted folder. Therefore, the template changes the @preseed_path to @image_path by replacing the Installation Media path with an .iso (see the code mentioned before). Accordingly, the following:

http://ourlocalrepository.com:8000/foreman_isos/ubuntu-22.04-live-server-amd64/

should become:

http://ourlocalrepository.com:8000/foreman_isos/ubuntu-22.04-live-server-amd64.iso

assuming that the iso is placed right next to the extracted Installation Media path as described in the documentation.

You could also put the iso image in some other place, you just have to adapt the image_path variable in the PXEGrub2 template accordingly.

@s3v3ran You’re btw absolutely right about how-to’s on this topic. Since questions are piling up about Ubuntu 22.04 deployment, @maximilian mentioned having a blog post on this topic might clarify most questions :crossed_fingers: I might write one in near future

Hello. Thanks for all the hints. Now it works like a charm. Basically I had to do the following:
1 - use an extracted iso image as an Installation media
2 - use an iso image in PXEGrub2 template as url
3 - rewrite a provisioning template in preseed format to user-data template in cloud-config yaml format
4 - rewrite a partitioning template from preseed to cloud-config yaml format
I also had to do some adjustments in finish template, but it wasn’t essential.

1 Like

Hey! I’m happy it works not. Actually, point 3 and 4 should be provided with the latest foreman. Have a look here:

and here: