Jump to content

Kickstart (Linux): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m →‎See also: Removed non-relevant external link to a product/advertisement
(48 intermediate revisions by 35 users not shown)
Line 1: Line 1:
{{Primary sources|date=September 2009}}
{{Primary sources|date=September 2009}}
The Red Hat '''kickstart''' installation method<ref name="Anaconda/Kickstart definition from the Fedora project">[http://fedoraproject.org/wiki/Anaconda/Kickstart Anaconda/Kickstart definition] from the Fedora project</ref> is used primarily (but not exclusively) by the [[Red Hat Enterprise Linux]] operating system to automatically perform unattended operating system installation and configuration. Red Hat publishes [[Cobbler (software)|Cobbler]] as a tool to automate the ''kickstart'' configuration process.
The Red Hat '''Kickstart''' installation method is used by [[Fedora (operating system)|Fedora]], [[Red Hat Enterprise Linux]] and related Linux distributions to automatically perform unattended operating system installation and configuration. Red Hat publishes [[Cobbler (software)|Cobbler]] as a tool to automate the Kickstart configuration process.


== Usage ==
== Usage ==
''Kickstart'' is normally used at sites with many [[Linux]] systems, to allow easy installation<ref name="Complete Kickstart: How to Save Time Installing Linux">[http://www.linux-mag.com/id/6747/ "Complete Kickstart: How to Save Time Installing Linux"] at Linux Magazine</ref> and consistent configuration of new computers being set up.
Kickstart is normally used at sites with many such Linux systems, to allow easy installation<ref name="Complete Kickstart: How to Save Time Installing Linux">[https://www.linuxtoday.com/blog/install-kickstart-linux/ "Complete Kickstart: How to Save Time Installing Linux"] at Linux Today</ref> and consistent configuration of new computer systems.


Kickstart configuration files can be built three ways:
''Kickstart'' configuration files can be built by hand or using the GUI system-config-kickstart tool. Additionally the standard Red Hat installation program [[Anaconda (installer)|Anaconda]] will produce a ''kickstart'' configuration file at the end of any manual installation process(/root/anaconda-ks.cfg). This file can then be taken and either used to automatically reproduce the same installation or edited (either manually or with system-config-kickstart).
# By hand.
# By using the GUI system-config-kickstart tool.
# By using the standard Red Hat installation program [[Anaconda (installer)|Anaconda]].

Anaconda will produce an anaconda-ks.cfg configuration file at the end of any manual installation. This file can be used to automatically reproduce the same installation or edited (manually or with system-config-kickstart).


== Structure ==
== Structure ==
The kickstart file is a simple text file, containing a list of items, each identified by a keyword.
A ''kickstart'' file consists of a series of options to be passed to the Anaconda installer which describe how to setup the system, optionally it may include custom scripts to be run before and/or after the installation.


While not strictly required, there is a natural order for sections that should be followed. Items within the sections do not have to be in a specific order unless otherwise noted. The section order is:
The process of a ''kickstart'' installation<ref name="kickstart installation Guide at RedHat">[http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/Installation_Guide-en-US/ch-kickstart2.html Chapter 28 (Kickstart) of the official RHEL 5 Installation Guide], accessed March 18 2009</ref> is as follows:

# Boot the machine from a CD/DVD, a USB device or (most commonly) over the network using [[Preboot Execution Environment|PXE]] and the network protocols [[Dynamic Host Configuration Protocol]] ('''DHCP''') and [[Trivial File Transfer Protocol]] ('''TFTP''').
* Command section – single line general purpose commands.
# The ''kickstart'' file, which needs to either be located on the boot media or be accessible over the network, is downloaded.
* The <code>%packages</code> section – listing of software packages to be installed & related options.
# An Anaconda installation is automatically launched and the ''kickstart'' file is consulted for the location of the Installation Tree. This can be on the USB device or CD-ROM boot media, however it is again most commonly provided over the network through either FTP, HTTP or NFS.
* The <code>%pre</code>, <code>%pre-install</code>, <code>%post</code>, <code>%onerror</code>, and <code>%traceback</code> sections – can contain scripts that will be executed at the appropriate time during the installation.
# Once the installer has access to the Installation Tree it attempts an unattended installation. If however it can't get all the required information from the ''kickstart'' file it may prompt the user (this can be eliminated by correctly configuring the ''kickstart'' file)

The <code>%packages</code>, <code>%pre</code>, <code>%pre-install</code>, <code>%post</code>, <code>%onerror</code>, and <code>%traceback</code> sections are all required to be closed with <code>%end</code>.

Items that are not required for the given installation run can be omitted.

Lines starting with a pound sign (<code>#</code>) are treated as comments and are ignored.

If deprecated commands, options, or syntax are used during a kickstart installation, a warning message will be logged to the anaconda log. Since deprecated items are usually removed within a release or two, it makes sense to check the installation log to make sure you haven’t used any of them. When using <code>ksvalidator</code>, deprecated items will cause an error.

== Example ==
A simple Kickstart for a fully automated Fedora installation.

<syntaxhighlight lang="text">
# use Fedora mirror as installation source, set Fedora version and target architecture
url --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-33&arch=x86_64

# set installation language
lang en_US.UTF-8

# set keyboard
keyboard us

# set root password
rootpw 12345

# create a sudo capable user
user --name wikipedia-user --password 12345 --groups=wheel

#set timezone
timezone America/New_York

# clear all existing storage (!)
zerombr
clearpart --all --initlabel

# automatically create default storage layout
autopart

%packages
# install the Fedora Workstation environment
@^Fedora Workstation
# install some package groups
@3D Printing
@C Development Tools and Libraries
@System Tools
# install some packages
vim
git
mc
%end
</syntaxhighlight>

== External links ==
* [https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-2-kickstart-commands-in-fedora Kickstart commands in Fedora] - Kickstart command reference for Fedora
* [https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_installation/kickstart-commands-and-options-reference_installing-rhel-as-an-experienced-user Kickstart command and options reference] - Kickstart command reference for RHEL 8


== See also ==
== See also ==
* [[Cobbler (software)|Cobbler]]<ref name="Automated installation with the Cobbler provisioning tool">[https://www.linux-magazine.com/Issues/2009/98/Cobbler/(language)/eng-US "Automated installation with the Cobbler provisioning tool"] at Linux Magazine</ref>
* [[Jumpstart (Solaris)]]
* [[Jumpstart (Solaris)]]
* [[Preseed]] (Debian, Ubuntu)
* [[Fully Automatic Installation]]
* [https://fai-project.org FAI] (Debian, Ubuntu, CentOS, SUSE)

* [[AutoYaST]] (SUSE)
=== External links ===
* [[Installation (computer programs)#system installer|System Installer]]
* [http://www.stanford.edu/~alfw/PXE-Kickstart/PXE-Kickstart.html How to Install Red Hat Linux via PXE and Kickstart], Dr. rer. nat. Alf Wachsmann of the National Accelerator Laboratory at Stanford University.
* [[Network Installation Manager]]


== References ==
== References ==
{{Reflist}}
{{Reflist}}

[[Category:Linux package management-related software]]




{{Install-software-stub}}
[[Category:Unix package management-related software]]

Revision as of 08:30, 3 November 2022

The Red Hat Kickstart installation method is used by Fedora, Red Hat Enterprise Linux and related Linux distributions to automatically perform unattended operating system installation and configuration. Red Hat publishes Cobbler as a tool to automate the Kickstart configuration process.

Usage

Kickstart is normally used at sites with many such Linux systems, to allow easy installation[1] and consistent configuration of new computer systems.

Kickstart configuration files can be built three ways:

  1. By hand.
  2. By using the GUI system-config-kickstart tool.
  3. By using the standard Red Hat installation program Anaconda.

Anaconda will produce an anaconda-ks.cfg configuration file at the end of any manual installation. This file can be used to automatically reproduce the same installation or edited (manually or with system-config-kickstart).

Structure

The kickstart file is a simple text file, containing a list of items, each identified by a keyword.

While not strictly required, there is a natural order for sections that should be followed. Items within the sections do not have to be in a specific order unless otherwise noted. The section order is:

  • Command section – single line general purpose commands.
  • The %packages section – listing of software packages to be installed & related options.
  • The %pre, %pre-install, %post, %onerror, and %traceback sections – can contain scripts that will be executed at the appropriate time during the installation.

The %packages, %pre, %pre-install, %post, %onerror, and %traceback sections are all required to be closed with %end.

Items that are not required for the given installation run can be omitted.

Lines starting with a pound sign (#) are treated as comments and are ignored.

If deprecated commands, options, or syntax are used during a kickstart installation, a warning message will be logged to the anaconda log. Since deprecated items are usually removed within a release or two, it makes sense to check the installation log to make sure you haven’t used any of them. When using ksvalidator, deprecated items will cause an error.

Example

A simple Kickstart for a fully automated Fedora installation.

# use Fedora mirror as installation source, set Fedora version and target architecture
url --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-33&arch=x86_64

# set installation language
lang en_US.UTF-8

# set keyboard
keyboard us

# set root password
rootpw 12345

# create a sudo capable user
user --name wikipedia-user --password 12345 --groups=wheel

#set timezone
timezone America/New_York

# clear all existing storage (!)
zerombr
clearpart --all --initlabel

# automatically create default storage layout
autopart

%packages
# install the Fedora Workstation environment
@^Fedora Workstation
# install some package groups
@3D Printing
@C Development Tools and Libraries
@System Tools
# install some packages
vim
git
mc
%end

See also

References