Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Last active September 13, 2019 11:15
Show Gist options
  • Save kevsersrca/013dec9e9aa006f31c2e6de6cfd564fd to your computer and use it in GitHub Desktop.
Save kevsersrca/013dec9e9aa006f31c2e6de6cfd564fd to your computer and use it in GitHub Desktop.
Kickstart Notes for Virtualization 😍
#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
network --device=eno1 --onboot=on --activate
network --bootproto=static --ip=x.x.x.x --netmask=255.255.255.0 --gateway=x.x.x.x --nameserver=8.8.8.8
network --hostname=localhost.localdomain
# Root password
rootpw --iscrypted someLongHashedPassword
# System timezone
timezone someTimeZone --isUtc --nontp
user --name=someUserName --password=someLongHashedPassword --iscrypted --gecos="someUserName"
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda
# Partition clearing information. Erases all partitions from the sda drive.
clearpart --all --initlabel --drives=sda
# Disk partitioning information
part pv.204 --fstype="lvmpv" --ondisk=sda --size=1902212
part /boot/efi --fstype="efi" --ondisk=sda --size=200 --fsoptions="umask=0077,shortname=winnt"
part /boot --fstype="xfs" --ondisk=sda --size=500
volgroup centos --pesize=4096 pv.204
logvol / --fstype="xfs" --grow --maxsize=51200 --size=1024 --name=root --vgname=centos
logvol /home --fstype="xfs" --size=230400 --name=home --vgname=centos
logvol swap --fstype="swap" --size=7808 --name=swap --vgname=centos
%packages
@base
@compat-libraries
@core
@debugging
@development
@network-file-system-client
@remote-system-management
@security-tools
@smart-card
@virtualization-hypervisor
@virtualization-platform
@virtualization-tools
@virtualization-client
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
@kevsersrca
Copy link
Author

kevsersrca commented Jan 5, 2018

d-i debian-installer/language                               string      en_US:en
d-i debian-installer/country                                string      US
d-i debian-installer/locale                                 string      en_US
d-i debian-installer/quiet                                  boolean     false
d-i debian-installer/splash                                 boolean     false
d-i localechooser/supported-locales                         multiselect en_US.UTF-8
d-i pkgsel/language-packs                                   multiselect en
d-i pkgsel/install-language-support                         boolean     false


# keyboard selection
d-i console-setup/ask_detect                                boolean     false
d-i keyboard-configuration/modelcode                        string      pc105
d-i keyboard-configuration/layoutcode                       string      us
d-i keyboard-configuration/variantcode                      string      intl
d-i keyboard-configuration/xkb-keymap                       select      us(intl)
d-i keyboard-configuration/xkb-keymap                       select      us
d-i debconf/language                                        string      en_US:en

# Choose an network interface that has link if possible.
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/wireless_wep string
d-i netcfg/choose_interface select eth0
d-i netcfg/get_ipaddress string x.x.x.x
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string x.x.x.x
d-i netcfg/get_nameservers string 8.8.8.8
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string test
d-i netcfg/get_domain string 
d-i netcfg/hostname string test

# Mirror settings.
#d-i mirror/country string manual
#d-i mirror/http/hostname string ftp.nl.debian.org
#d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
d-i mirror/country                                          string      US
d-i mirror/http/mirror                                      string      us.archive.ubuntu.com
d-i mirror/http/directory                                   string      /ubuntu

# Root account setup. You can set password in plain-text or pre-encrypted.
d-i passwd/root-login boolean true
d-i passwd/root-password password 123
d-i passwd/root-password-again password 123

# User account setup.
d-i passwd/user-fullname string Dmitri Popov
d-i passwd/username string ubuntu
d-i passwd/user-password password 123
d-i passwd/user-password-again password 123
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home                                 boolean     false

# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# See the contents of /usr/share/zoneinfo/ for valid values.
d-i time/zone string Europe/Berlin
# Controls whether to use NTP to set the clock during the install.
d-i clock-setup/ntp boolean true


# configure apt
d-i apt-setup/restricted                                    boolean     true
d-i apt-setup/universe                                      boolean     true
d-i apt-setup/backports                                     boolean     true
d-i apt-setup/services-select                               multiselect security
d-i apt-setup/security_host                                 string      security.ubuntu.com
d-i apt-setup/security_path                                 string      /ubuntu
tasksel tasksel/first                                       multiselect standard, ubuntu-server, openssh-server
openssh-server openssh-server/permit-root-login             boolean     true
d-i pkgsel/upgrade                                          select      none
d-i pkgsel/update-policy                                    select      none
d-i pkgsel/updatedb                                         boolean     true


# Simple non-LVM, all files in one partition.
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true


d-i partman-auto/init_automatically_partition select biggest_free
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true



d-i grub-installer/only_debian                              boolean     true
d-i grub-installer/with_other_os                            boolean     true
d-i grub-installer/bootdev                                  string      default
d-i debian-installer/add-kernel-opts                        string      net.ifnames=0 biosdevname=0 audit=0 cgroup_enable=memory swapaccount=1

# finish installation
d-i finish-install/reboot_in_progress                       note
d-i finish-install/keep-consoles                            boolean     false
d-i cdrom-detect/eject                                      boolean     true
d-i debian-installer/exit/halt                              boolean     false
d-i debian-installer/exit/poweroff                          boolean     false

@kevsersrca
Copy link
Author

#version=DEVEL
install
url --url=http://ftp.funet.fi/pub/mirrors/centos.org/6/os/x86_64/
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --ipv6 auto
rootpw  --iscrypted $6$GtMiMcUTplxvziNh$HPWRzZ8r2rDIBJIcCHspIfwTf5jbSPDXmvJUdy7cDRG01KMmG3Qs91c2U6cIShqaYBENTLU3xqyTMFrDpSfaa.
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc America/New_York
bootloader --location=mbr --driveorder=vda --append="crashkernel=auto rhgb quiet"
zerombr yes
clearpart --linux --drives=vda
volgroup VolGroup --pesize=4096 pv.253002
logvol / --fstype=ext4 --name=lv_root --vgname=VolGroup --grow --size=1024 --maxsize=51200
logvol swap --name=lv_swap --vgname=VolGroup --grow --size=4032 --maxsize=4032

part /boot --fstype=ext4 --size=500
part pv.253002 --grow --size=1

repo --name="CentOS"  --baseurl=http://ftp.funet.fi/pub/mirrors/centos.org/6/os/x86_64/ --cost=100

%packages
@base
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@java-platform
@large-systems
@network-file-system-client
@performance
@perl-runtime
@server-platform
@server-policy
@workstation-policy
pax
python-dmidecode
oddjob
sgpio
device-mapper-persistent-data
samba-winbind
certmonger
pam_krb5
krb5-workstation
perl-DBD-SQLite

@kevsersrca
Copy link
Author

#
#Generic Kickstart template for Ubuntu
#Platform: x86 and x86-64
#

#System language
lang en_US

#Language modules to install
langsupport en_US

#System keyboard
keyboard us

#System mouse
mouse

#System timezone
timezone America/New_York

#Root password
rootpw --iscrypted $6$GtMiMcUTplxvziNh$HPWRzZ8r2rDIBJIcCHspIfwTf5jbSPDXmvJUdy7cDRG01KMmG3Qs91c2U6cIShqaYBENTLU3xqyTMFrDpSfaa.

#Initial user (user with sudo capabilities) 
user ubuntu --fullname "Ubuntu User" --password 123qwe

preseed user-setup/allow-password-weak boolean true

#Reboot after installation
reboot

#Use text mode install
text

#Install OS instead of upgrade
install

#Installation media
cdrom
#nfs --server=server.com --dir=/path/to/ubuntu/

#System bootloader configuration
bootloader --location=mbr 

#Clear the Master Boot Record
zerombr yes

#Partition clearing information
clearpart --all --initlabel 

#Basic disk partition
part / --fstype ext4 --size 1 --grow --asprimary 
part swap --size 1024 
part /boot --fstype ext4 --size 256 --asprimary 

#Advanced partition
#part /boot --fstype=ext4 --size=500 --asprimary
#part pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr --grow --size=1
#volgroup vg_mygroup --pesize=4096 pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr
#logvol / --fstype=ext4 --name=lv_root --vgname=vg_mygroup --grow --size=10240 --maxsize=20480
#logvol swap --name=lv_swap --vgname=vg_mygroup --grow --size=1024 --maxsize=8192

#System authorization infomation
auth  --useshadow  --enablemd5 

#Network information
network --bootproto=static --ip=x.x.x.x--netmask=255.255.255.0 --gateway=x.x.x.x --nameserver=8.8.8.8 --device=eth1
#network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled 

#Do not configure the X Window System
skipx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment