Proxmox PXE Auto Install


A few weeks ago, I bought 3 second-hand OptiPlexes to create actual Proxmox and Kubernetes clusters, as opposed to everything living on my PC. As I was installing Proxmox on the machines, I was annoyed by the clickops and USB sticks required to setup each machine, so I thought it would be a good opportunity to try setting up an automated PXE installation.

I found a tutorial on how to do this, but it required extracting and manipulating the ISO. I decided to follow the official docs first, hoping that Proxmox 9 had fixed the issue. Following the docs, I generated the initrd and vmlinuz files by running proxmox-auto-install-assistant and used grub-mknetdir to create the bootloader. Since my network uses a simple home router, I turned off its DHCP server and configured dnsmasq to serve the files over TFTP. It successfully booted into the bootloader, but when it got to Proxmox’s installer, it threw a “no device with valid ISO found” error. It turned out this was a known limitation, and there was no way around it.

Modifying the ISO sounded intimidating, but it was actually quite simple. All I had to do was use proxmox-auto-install-assistant and inject the generated ISO into the root of the generated initrd. I also switched from standard PXE to iPXE, which was much simpler since I just needed to download the ipxe.efi file from https://boot.ipxe.org/ and put it in my TFTP root to fetch files over HTTP. For the HTTP server, I created a simple FastAPI server to dynamically serve the Proxmox answer files based on the machine’s MAC address. I also added a post-install script to switch from the enterprise repository to the no-subscription repository.

Currently, to reinstall a node, I still need to plug in a keyboard and monitor to manually select network boot. The next step is to enable Wake-on-LAN, use smart plugs for hard resets, set PXE as the default boot option, and use my FastAPI server to remotely control whether a machine boots into Proxmox or triggers a fresh install. I’m stopping here for now, at least until I get a more advanced router.

If you want to check out the setup or try it yourself, here is the GitHub repo containing the scripts I used: https://github.com/laujonathan6/proxmox-pxe