Network-booting Fedora

Fedora logo

You can use iPXE to boot into the 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 Red Hat Enterprise Linux (RHEL) and CentOS.

Boot script

Create an iPXE script file fedora.ipxe containing:

  #!ipxe
  
  # Set source URI
  set mirror http://download.fedoraproject.org/pub/fedora/linux/releases/41
  
  # 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/41

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:

Booting from fedora.ipxe script

Fedora installation screen

You can now install Fedora to a local hard disk. Congratulations on successfully network-booting the Fedora installer!

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/41
  
  # 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 SAN URI of your iSCSI or FCoE target.

Automating the installation

You can use a kickstart file and the inst.ks=… kernel command line parameter to automate the actions taken once iPXE has started the Fedora installer. For example, if you have placed your ks.cfg file in your repository directory:

  # Start automated installer if F12 is pressed
  prompt --key 0x197e --timeout 2000 Press F12 to install Fedora... || exit
  kernel ${repo}/images/pxeboot/vmlinuz initrd=initrd.img inst.repo=${repo} inst.ks=${repo}/ks.cfg
  initrd ${repo}/images/pxeboot/initrd.img
  boot
howto/fedora.txt · Last modified: 2024/11/13 13:06 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.