KVM: Install CentOS / RHEL Using Kickstart File (Automated Installation)

Here are the steps to install CentOS or RHEL on KVM using a kickstart file for automated installation:

  1. Create a kickstart file (e.g. ks.cfg) with the desired installation configuration. You can use the Kickstart Configurator tool to generate a kickstart file with a GUI or create one manually.
  2. Save the kickstart file to a web server, FTP server, or USB drive that is accessible to the virtual machine.
  3. Create a new virtual machine in KVM and configure it as follows:
  • Use the same ISO file that you would use for a manual installation.
  • Set the boot device to CDROM.
  • Allocate sufficient memory and storage for the virtual machine.
  • Set the network type to Bridged to allow the virtual machine to access the network during installation.
  • Set the virtual CDROM drive to use the ISO file and the kickstart file as the installation source.
  1. Start the virtual machine and wait for the installation to begin.
  2. At the boot prompt, press the Tab key to edit the boot options.
  3. Append the following options to the kernel boot command:
ks=http://path/to/ks.cfg inst.ks.sendmac

Replace “http://path/to/ks.cfg” with the URL or path to the kickstart file.

The “inst.ks.sendmac” option is necessary to ensure that the virtual machine’s MAC address is sent to the kickstart file. This is required for network configuration.

  1. Press Enter to start the installation process.
  2. The installation should proceed automatically according to the configuration specified in the kickstart file.

Once the installation is complete, the virtual machine should boot into the newly installed CentOS or RHEL operating system.

Leave a Comment