Skip to content

πŸš€ Creating a Kickstart File for Network Installation on Fedora

This guide will show you how to create a Kickstart file and make it available over the network for automated Fedora installations.


πŸ“š Table of Contents

  1. Introduction
  2. Requirements
  3. Creating a Kickstart File
  4. Setting up a Network Server
  5. Accessing the Kickstart File via Network
  6. Testing the Network Boot
  7. Summary Script

1. Introduction

A Kickstart file is used to automate Fedora installations, which saves time by providing pre-configured installation parameters. By serving this file over the network, you can use it on multiple machines without needing a USB stick or CD.


2. Requirements

To set up and access a Kickstart file over the network, you need:

  • A Fedora-based server or any Linux machine with web or FTP server installed.
  • A Kickstart file (.ks file).
  • Client machines that support network boot (PXE boot).

3. Creating a Kickstart File

First, you need to create a basic Kickstart file.

  1. Generate a Kickstart File: You can use the anaconda-ks.cfg file, which is generated after every Fedora installation. The file can be found at /root/anaconda-ks.cfg.

To create or modify a Kickstart file:

sudo nano /path/to/your/kickstart.ks
  1. Basic Example of a Kickstart File:
# Kickstart Config for Automated Fedora Installation

# Language
lang en_US.UTF-8

# Keyboard layout
keyboard us

# Network settings
network --bootproto=dhcp

# Root password
rootpw --iscrypted <encrypted_password>

# Partitioning
autopart --type=lvm

# Package Selection
%packages
@base
@core
%end

4. Setting up a Network Server

Next, you need to make this file available over the network. There are two popular methods to host a Kickstart file over the network: HTTP/HTTPS and FTP.

A. Using HTTP Server

  1. Install Apache HTTP Server:
sudo dnf install httpd -y
  1. Start the Apache Server:
sudo systemctl start httpd
sudo systemctl enable httpd
  1. Move the Kickstart File to the Web Directory: Place your Kickstart file (kickstart.ks) in the default web directory /var/www/html:
sudo cp /path/to/your/kickstart.ks /var/www/html/kickstart.ks
  1. Ensure Permissions: Make sure the web server can access the file:
    sudo chmod 644 /var/www/html/kickstart.ks
    

B. Using FTP Server

  1. Install vsftpd (FTP Server):
sudo dnf install vsftpd -y
  1. Start and Enable FTP Service:
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
  1. Move Kickstart File to FTP Directory: By default, FTP serves files from /var/ftp/pub. Copy the Kickstart file there:
sudo cp /path/to/your/kickstart.ks /var/ftp/pub/kickstart.ks
  1. Enable FTP Access by modifying /etc/vsftpd/vsftpd.conf and restarting the service.

5. Accessing the Kickstart File via Network

On the client machine, you will specify the location of the Kickstart file during installation:

  1. For HTTP: During boot, pass the following option:
inst.ks=http://<server-ip>/kickstart.ks
  1. For FTP:
    inst.ks=ftp://<server-ip>/pub/kickstart.ks
    

Make sure to replace <server-ip> with the actual IP address of your network server.


6. Testing the Network Boot

  1. Configure PXE Boot: On the client machine, ensure PXE boot is enabled. This will allow the machine to boot from the network.
  2. Start the Installation:
  3. Boot the machine.
  4. Access the boot menu (usually by pressing F12, Esc, or Del).
  5. Select Network Boot.
  6. Specify the Kickstart file’s URL using inst.ks= as shown above.

The Fedora installer will use the Kickstart file from the network and proceed with an automated installation.


7. Summary Script

Here’s a summary of what you’ve done to access a Kickstart file over the network:

# On the server:
# Install Apache HTTP server
sudo dnf install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

# Copy the Kickstart file to the web directory
sudo cp /path/to/your/kickstart.ks /var/www/html/kickstart.ks
sudo chmod 644 /var/www/html/kickstart.ks

# On the client:
# During boot, pass this argument (for HTTP)
inst.ks=http://<server-ip>/kickstart.ks

# Or for FTP (if FTP server is set up)
inst.ks=ftp://<server-ip>/pub/kickstart.ks