Skip to content

Instantly share code, notes, and snippets.

@marekjelen
Last active December 14, 2015 02:29
Show Gist options
  • Save marekjelen/5014477 to your computer and use it in GitHub Desktop.
Save marekjelen/5014477 to your computer and use it in GitHub Desktop.
Fedora KickStart
# Install, not upgrade
install
# Install from a friendly mirror and add updates
url --url=http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/19/Fedora/x86_64/os/
repo --name=updates
# Language and keyboard setup
lang en_US.UTF-8
keyboard us
# Configure DHCP networking w/optional IPv6, firewall on
network --onboot yes --device eth0 --bootproto dhcp --ipv6 auto --hostname fedora.local
firewall --service=ssh
# Set timezone
timezone --utc Etc/UTC
# Authentication
rootpw qwerty
authconfig --enableshadow --passalgo=sha512
# SELinux
selinux --enforcing
# Services running at boot
services --enabled network,sshd
services --disabled sendmail
# Disable anything graphical
skipx
text
# Setup the disk
zerombr
clearpart --all
part / --fstype=ext4 --grow --size=1024 --asprimary
#part swap --size=512 # lets do no swap partition for now
bootloader --location=mbr --timeout=5
# Shutdown when the kickstart is done
halt
# Minimal package set
%packages --excludedocs --nobase
@Core
%end
# Nothing for now.
#%post
#%end
#!/bin/sh
set -e
NAME="fedora";
DISK=/opt/"$NAME"
CMDLINE='ks=http://www.fpaste.org/nCWp/raw/'
for ARG
do
CMDLINE="$CMDLINE $ARG"
done
set -x
qemu-img create "$DISK" 30G -f raw && mkfs.ext4 -F "$DISK"
virt-install --name="$NAME" --ram=2048 --vcpus=2 --hvm --disk "$DISK" \
--location http://mirror.itc.virginia.edu/fedora/releases/18/Fedora/x86_64/os/ \
-x "$CMDLINE" \
--connect qemu:///system --network bridge=virbr0 --graphics vnc -d --wait=-1 \
--autostart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment