Deploying ESXi through Foreman

At the time of writing this (Foreman v1.18), ESXi deployment through Foreman is not supported natively. The problem is exacerbated by the fact that the ESXi Legacy BIOS bootloader depends on an older Syslinux (v3.86) and GRUB2 not being able to chainload the ESXi EFI bootloader. However there are quite a few articles on the Internet that have attempted to work around these issues. This post is an attempt to bring all the information together in one place, simplify the process and most importantly, support both Legacy BIOS and UEFI modes of installation. Huge thanks to the foreman developers for helping me out whenever I was stuck.

This is a companion discussion topic for the original entry at

I wonder why the legacy PXELinux is named subdirectory/pxelinux.0 and not pxelinux-legacy.0 that way it should be able to load the standard configuration files. Maybe configuration syntax is no longer compatible?

I wonder why the legacy PXELinux is named subdirectory/pxelinux.0 and not pxelinux-legacy.0

Because pxelinux.0 v3.86 is kept under {tftproot}/syslinux386/ and not directly under {tftproot}/.
So are you saying we should keep it under {tftproot} directly and rename it to pxelinux-3.86.0? Then what about the supporting v3.86 *.c32 files (v3.86 pxelinux.0 is incompatible with the default .c32 files)? Where do we keep those?

Oh I haven’t realized that there are those c32 files. These are indeed not compatible. Only if there was a way to embedd them into the .0 file like for grub2, or load them via relative path.

1 Like

Hi, I was able to get ESXI to provision using iPXE to chanload to mboot.efi and avoid any hook script.

echo Booting ESXi install from HTTP
kernel <%= @host.os.medium_uri(@host) %>mboot.efi -c <%= @host.os.medium_uri(@host) %>boot.cfg ks=<%= foreman_url('provision') %> ksdevice=<%= @host.mac %> network kssendmac ks.sendmac inst.ks.sendmac
boot || goto failed

Yes…the iPXE based procedure is covered here Foreman :: Install ESXi through Foreman using iPXE bootstrapping


Hello Team, i need your advice.

I have Foreman in my infrastructure and i want configure ESXi installation. I did everithig like in this post
Deploying ESXi through Foreman.

After ESXi installation it didn’t send information to Foremn to delete the config, after reboot system start installation again and only after removing config manually it stops installation.

Scripts below didn’t work
%post --interpreter=busybox

Add temporary DNS resolution so the foreman call works

echo “nameserver <%= @host.subnet.dns_primary %>” >> /etc/resolv.conf

Inform Foreman that we are done.

wget -O /dev/null <%= foreman_url(‘built’) %>
echo “Done with Foreman call”

How can i send information to Foreman to stop installation?