LoginSignup
32
29

More than 5 years have passed since last update.

CentOS7でkickstartしてみた

Last updated at Posted at 2014-07-07

DVDから普通にインストール

/root/anaconda-ks.cfgをwebサーバにコピーしておく。

anaconda-ks.cfgを利用

BIOSの場合

  1. DVD挿入
  2. Esc押す
  3. linux text ks=http://192.168.0.103:8887/anaconda-ks.cfg

EFIの場合

  1. DVD挿入
  2. e押す
  3. 最後に text ks=http://192.168.0.103:8887/anaconda-ks.cfgをつける
  4. ctrl-x を押しBOOT (ctrl-xが効かない場合はF10)

もしくは

  1. text ks=hd:sdc1:/ks/centos7.cfg

スクリーンショット 2014-07-08 9.03.06.png

anaconda-ks.cfgサンプル

例1: BIOSの場合

#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512

# Use CDROM installation media
cdrom
# Use text mode install
text
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=jp106 --xlayouts='jp106'
# System language
lang en_US.UTF-8
# custom
firewall --disabled
selinux --disabled

# Network information
network  --bootproto=dhcp --device=enp0s3 --onboot=off --ipv6=auto
network  --hostname=localhost.localdomain
#Root password
rootpw --lock
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Tokyo --isUtc
#user --groups=wheel --name=vagrant --password= --iscrypted --gecos="vagrant"
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
#autopart --type=plain #xfs
#autopart --type=ext4
autopart --type=btrfs
# Partition clearing information
clearpart --all --initlabel --drives=sda

%packages
@core
telnet
#logwatch
#vim-enhanced
#git
#gitweb ruby
%end

%pre
%end

%post
%end

例2: EFIの場合

#version=RHEL7
# System authorization information
auth --enableshadow --passalgo=sha512

# Use CDROM installation media
cdrom
# Use text mode install
text
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=jp106 --xlayouts='jp106'
# System language
lang en_US.UTF-8
firewall --disabled
selinux --disabled

# Network information
network  --bootproto=static --device=enp3s0 --gateway=192.168.0.1 --ip=192.168.0.2 --nameserver=8.8.8.8,8.8.4.4 --netmask=255.255.255.0 --ipv6=auto --activate
network  --hostname=centos7.local
#Root password
rootpw --lock
# Do not configure the X Window System
skipx
# System timezone
timezone Asia/Tokyo --isUtc
#user --groups=wheel --name=vagrant --password= --iscrypted
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
autopart --type=btrfs
# Partition clearing information
clearpart --all --initlabel --drives=sda

%packages
@core
%end

パスワード生成

openssl passwd -1
32
29
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
32
29