PXE
Perfect! I’ll generate a ready-to-use preseed file for Ubuntu 22.04 PXE static install with:
- Static IP configuration
- One root partition (
/) - One default user (
ubuntu) - Auto timezone, locales, and packages
- Network boot compatible
This will allow fully unattended PXE installation.
✅ 1. Preseed file
Section titled “✅ 1. Preseed file”Create /var/lib/tftpboot/ubuntu/preseed.cfg:
# Localizationd-i debian-installer/locale string en_US.UTF-8d-i console-setup/ask_detect boolean falsed-i keyboard-configuration/layoutcode string us
# Network configuration (static)d-i netcfg/choose_interface select autod-i netcfg/get_hostname string ubuntu-pxed-i netcfg/get_domain string locald-i netcfg/disable_dhcp boolean trued-i netcfg/get_ipaddress string 192.168.1.150d-i netcfg/get_netmask string 255.255.255.0d-i netcfg/get_gateway string 192.168.1.1d-i netcfg/get_nameservers string 8.8.8.8
# Mirror settingsd-i mirror/country string manuald-i mirror/http/hostname string archive.ubuntu.comd-i mirror/http/directory string /ubuntud-i mirror/http/proxy string
# Clock and time zoned-i clock-setup/utc boolean trued-i time/zone string Etc/UTCd-i clock-setup/ntp boolean true
# Partitioningd-i partman-auto/method string regulard-i partman-auto/choose_recipe select atomicd-i partman-auto/disk string /dev/sdad-i partman/confirm boolean trued-i partman/confirm_nooverwrite boolean true
# Root passwordd-i passwd/root-login boolean falsed-i passwd/make-user boolean trued-i passwd/user-fullname string Ubuntu Userd-i passwd/username string ubuntud-i passwd/user-password password ubuntud-i passwd/user-password-again password ubuntu
# Install base systemtasksel tasksel/first multiselect standardd-i pkgsel/include string openssh-serverd-i pkgsel/upgrade select none
# Boot loaderd-i grub-installer/only_debian boolean trued-i finish-install/reboot_in_progress note
# Avoid promptsd-i debconf/priority string criticald-i preseed/late_command string \ in-target sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config; \ in-target systemctl enable ssh✅ 2. Update PXE boot menu
Section titled “✅ 2. Update PXE boot menu”Edit /var/lib/tftpboot/pxelinux.cfg/default:
DEFAULT menu.c32PROMPT 0TIMEOUT 50ONTIMEOUT ubuntu
MENU TITLE PXE Boot MenuLABEL ubuntu MENU LABEL Install Ubuntu 22.04 Static KERNEL ubuntu/linux APPEND initrd=ubuntu/initrd.gz auto=true priority=critical preseed/file=/ubuntu/preseed.cfg ---✅ 3. Notes
Section titled “✅ 3. Notes”- Adjust IP addresses and netmask/gateway for your network.
- Password is
ubuntu(change for production). - After booting, installation is fully automated: disk is wiped, system is installed, SSH enabled.
- The PXE client will reboot automatically at the end.
✅ Next steps
Section titled “✅ Next steps”- Ensure
/var/lib/tftpboot/ubuntu/linuxand/var/lib/tftpboot/ubuntu/initrd.gzexist - Ensure
/var/lib/tftpboot/ubuntu/preseed.cfgexists and is readable - Test PXE boot on a VM first to verify IP and install
If you want, I can also create a version with multiple clients using unique IPs automatically, so you can deploy many machines at once via PXE fully unattended.
Do you want me to do that?