====== Network-booting Fedora ====== {{ :clipart:fedora_logo.png?50x50|Fedora logo}} You can use iPXE to boot into the [[http://fedoraproject.org/|Fedora]] Linux installer via HTTP. You can then install Fedora to a local hard disk or to an iSCSI or FCoE SAN target. These instructions should work for similar Linux distributions, such as [[http://www.redhat.com/products/enterprise-linux/|Red Hat Enterprise Linux (RHEL)]] and [[http://www.centos.org|CentOS]]. ===== Boot script ===== Create an iPXE [[:scripting|script]] file ''fedora.ipxe'' containing: #!ipxe # Set source URI set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/38 # Detect CPU architecture and calculate repository URI cpuid --ext 29 && set arch x86_64 || set arch i386 set repo ${mirror}/Everything/${arch}/os # Start installer kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img inst.repo=${repo} initrd ${repo}/images/pxeboot/initrd.img boot If you have mirrored the Fedora tree locally, then you should change the line set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/38 to point to the URI of your local mirror. Booting and installing from a local mirror will be several times faster than using the public ''download.fedoraproject.org'' mirror. ===== Installing to a local disk ===== Boot using iPXE from the URI of your ''fedora.ipxe'' script, e.g. ''%%http://my.web.server/fedora.ipxe%%''. You should see iPXE download and boot into the Fedora installer via HTTP: {{ :screenshots:fedora_boot.png?360x200 |Booting from fedora.ipxe script}} {{ :screenshots:fedora_install.png?360x281 |Fedora installation screen}} You can now install Fedora to a local hard disk. Congratulations on successfully network-booting the Fedora installer! {{ :clipart:smile.png?200x200 |Success}} ===== Installing to a SAN target ===== You can install Fedora to an iSCSI or FCoE SAN target instead of to a local disk. To do this, you must modify the ''fedora.ipxe'' script to allow for installation to your SAN target disk. For example: #!ipxe # Set source URI set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/38 # Set SAN target URI set target iscsi:192.168.0.1::::iqn.1992-01.com.example.target:fedora # Detect CPU architecture and calculate repository URI cpuid --ext 29 && set arch x86_64 || set arch i386 set repo ${mirror}/Everything/${arch}/os # Hook SAN target sanhook ${target} # Start installer if F12 is pressed, otherwise boot prompt --key 0x197e --timeout 2000 Press F12 to install Fedora... || sanboot kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img inst.repo=${repo} initrd ${repo}/images/pxeboot/initrd.img boot You must change the line set target iscsi:192.168.0.1::::iqn.1992-01.com.example.target:fedora to specify the [[:sanuri|SAN URI]] of your iSCSI or FCoE target.