Differences
This shows you the differences between two versions of the page.
— | centos_kickstart [2021/08/09 07:40] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CentOS Kickstart ====== | ||
+ | * [[CentOS]] | ||
+ | * [[CentOS Xen]] | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | === Introduction === | ||
+ | |||
+ | This guide is very similar in style to the [[Ubuntu autoinstall]] guide, in the sense that it makes a file to pre-define certain things. It is not as extensive as the other one, though, in modifying the ISOLINUX config files and so on. | ||
+ | |||
+ | When creating a Kickstart file, here are some simple things to know. | ||
+ | |||
+ | When the OS boots with the kickstarter, | ||
+ | |||
+ | < | ||
+ | yum install system-config-kickstart | ||
+ | system-config-kickstart | ||
+ | </ | ||
+ | |||
+ | === Download ISO === | ||
+ | |||
+ | The first thing to do is download the CentOS ISO you'd like to install. In this example, I'm using CentOS 6.6 (which is rather old). The kickstart file should work with newer installs as well. | ||
+ | |||
+ | < | ||
+ | wget http:// | ||
+ | </ | ||
+ | |||
+ | === Sample Kicsktarter File === | ||
+ | |||
+ | Here's a file I make to go through a quick text install. When finished, the file is saved as '' | ||
+ | |||
+ | Do a text installation, | ||
+ | |||
+ | < | ||
+ | install | ||
+ | cdrom | ||
+ | text | ||
+ | skipx | ||
+ | </ | ||
+ | |||
+ | Use locale settings: | ||
+ | |||
+ | < | ||
+ | keyboard us | ||
+ | lang en_US | ||
+ | </ | ||
+ | |||
+ | As well as timezone: | ||
+ | |||
+ | < | ||
+ | timezone --isUtc America/ | ||
+ | </ | ||
+ | |||
+ | I prefer to disable the firewall: | ||
+ | |||
+ | < | ||
+ | firewall --disabled | ||
+ | </ | ||
+ | |||
+ | As well as SELinux: | ||
+ | |||
+ | < | ||
+ | selinux --disabled | ||
+ | </ | ||
+ | |||
+ | Use shadow authentication for the passwords (which is the default on a system anyway): | ||
+ | |||
+ | < | ||
+ | auth --useshadow | ||
+ | </ | ||
+ | |||
+ | Create a generic user with password '' | ||
+ | |||
+ | < | ||
+ | user --name=centos --groups=wheel --password=insecure --shell=/ | ||
+ | </ | ||
+ | |||
+ | Set the root password to '' | ||
+ | |||
+ | < | ||
+ | rootpw insecure | ||
+ | </ | ||
+ | |||
+ | Shut down the system when all is finished: | ||
+ | |||
+ | < | ||
+ | poweroff | ||
+ | </ | ||
+ | |||
+ | === Partitioning === | ||
+ | |||
+ | Setting up the partitions is a tricky step, so refer to the documentation (or even better, the GUI) to set exactly what you want. | ||
+ | |||
+ | In this configuration, | ||
+ | |||
+ | The original bootloader is eradicated: | ||
+ | |||
+ | < | ||
+ | zerombr | ||
+ | </ | ||
+ | |||
+ | The new bootloader is installed in the MBR: | ||
+ | |||
+ | < | ||
+ | bootloader --location=mbr | ||
+ | </ | ||
+ | |||
+ | All existing partitions are removed: | ||
+ | |||
+ | < | ||
+ | clearpart --all --initlabel | ||
+ | </ | ||
+ | |||
+ | Create a ''/ | ||
+ | |||
+ | < | ||
+ | part /boot --fstype=ext3 --size=256 | ||
+ | </ | ||
+ | |||
+ | Create a swap partition, letting CentOS set the size: | ||
+ | |||
+ | < | ||
+ | part swap --fstype=swap --recommended | ||
+ | </ | ||
+ | |||
+ | Create an ext4 filesystem for ''/'', | ||
+ | |||
+ | < | ||
+ | part / --fstype=ext4 --grow --size=1 | ||
+ | </ | ||
+ | |||
+ | === Packages === | ||
+ | |||
+ | At the end of the kickstarter file, you can add some specific packages you'd like installed along with the base system. By default there' | ||
+ | |||
+ | You can display the packages that are available by mounting the ISO and looking int the '' | ||
+ | |||
+ | Add the list to the kickstarter file. Ignore missing ones just in case, so the install will continue if there' | ||
+ | |||
+ | < | ||
+ | %packages --ignoremissing | ||
+ | dhclient | ||
+ | </ | ||
+ | |||
+ | Some additional packages: | ||
+ | |||
+ | < | ||
+ | @ base | ||
+ | @ core | ||
+ | coreutils | ||
+ | yum | ||
+ | rpm | ||
+ | e2fsprogs | ||
+ | openssh-server | ||
+ | openssh-clients | ||
+ | dhclient | ||
+ | </ | ||
+ | |||
+ | === Creating the ISO === | ||
+ | |||
+ | Mount the original ISO, and copy its contents somewhere else: | ||
+ | |||
+ | < | ||
+ | mkdir / | ||
+ | mkdir / | ||
+ | mount -o loop,ro centos.iso / | ||
+ | cp -r / | ||
+ | </ | ||
+ | |||
+ | The original ISO won't be needed any more, so it can be unmounted if you feel like it: | ||
+ | |||
+ | < | ||
+ | umount / | ||
+ | </ | ||
+ | |||
+ | Once you've created the kickstarter config file, save it as '' | ||
+ | |||
+ | < | ||
+ | cp ks.cfg / | ||
+ | </ | ||
+ | |||
+ | Update the ISOLINUX config file to tell it where the kickstarter config file is. Edit the file ''/ | ||
+ | |||
+ | Update the first '' | ||
+ | |||
+ | < | ||
+ | append initrd=initrd.img ks=cdrom:/ | ||
+ | </ | ||
+ | |||
+ | Finally, build the new bootable ISO with the config file: | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | mkisofs -o / | ||
+ | </ | ||
+ | |||
+ | And boot the ISO as normal. You've got an automated install! |