====== PXE netboot ====== Via PXE / netboot, you can boot and install systems over network. Just switch the bios to PXE netboot. You need dnsmasq, it includes a tftpd server, which serves the boot images. ===== dnsmasq config ===== Example config: dhcp-range=192.168.20.100,192.168.20.150,12h dhcp-boot=pxelinux.0 enable-tftp tftp-root=/var/tftpd dhcp-option=3,192.168.20.1 dhcp-option=6,192.168.20.1 ===== tftpd ===== dnsmasq includes a tftp server, you just need to serve the pxe boot files from there. For debian, you can use: * an unpacked netboot.tar.gz http://ftp.debian.org/debian/dists/jessie/main/installer-amd64/current/images/netboot/netboot.tar.gz - it includes the pxelinux.cfg directory and debian-installer files. * a debian live cd: you can mount an iso and include it in the pxelinux.cfg/default bootmenu ===== pxelinux.cfg/default ===== this includes the bootmenu and is started, as soon as the client boots via pxe/tftp. put your matching config here. # the debian installer. this is included in netboot.tar.gz path debian-installer/amd64/boot-screens/ include debian-installer/amd64/boot-screens/menu.cfg default debian-installer/amd64/boot-screens/vesamenu.c32 prompt 0 timeout 0 # another entry for debian live - run without installing: LABEL Debian LiveCD MENU DEFAULT KERNEL ::/debianlive/live/vmlinuz # an automated installer, which downloads a preseed file: label Install Automat MENU DEFAULT kernel debian-installer/amd64/linux append vga=normal initrd=debian-installer/amd64/initrd.gz netcfg/choose_interface=eth0 domain=mynet keyboard-configuration/xkb-keymap=de locale=en_US.UTF-8 debian-installer/country=DE debian-installer/language=en debian-installer/keymap=de console-keymaps-at/keymap=de auto-install/enable=false preseed/url=http://192.168.20.22/netboot/preseed.cfg DEBCONF_DEBUG=5 -- quiet ===== preseed ===== You can automate the debian installer, so all questions get answered automagically, including formatting, network, software, everything :) Add a download url for the preseed file to the bootmenu in pxelinux.cfg/default. This can be served via nfs or web. Some things (like keyboard language) must be set in the 'append' line of the bootmenu - see above. If you preseed hangs and asks questions, you can switch to console 2 to see, what is going on. Complete pressed.cfg example: {{:linux:debian_install:preseed_demo.txt|}} ===== postinstall script ===== Some things are hard to preseed, so you run a script after the installer competes, inside the new system. Download the script and run it, with a similar command in the preseed file: d-i preseed/late_command string in-target wget -P /tmp/ http://192.168.1.1/netboot/postinst.sh; in-target chmod +x /tmp/postinst.sh; in-target /tmp/postinst.sh Complete postinstall script example: {{:linux:debian_install:postinst_demo.txt|}} ===== Links ===== * https://wiki.ubuntuusers.de/PXE-Boot/ * https://blog.mister-muffin.de/2011/09/12/multiboot-live-systems-via-pxe/ * https://www.hennignetz.de/howtos/debian_wheezy_pxe.shtml#Wheezy_Netinstall * https://wiki.debianforum.de/Debian-Installation_%C3%BCber_PXE,_TFTP_und_Preseed