LoginSignup
1
1

More than 5 years have passed since last update.

CentOS7:KickstartでKVM設定

Posted at

何かとCentOS7だとKVMの設定がCentOS6と微妙に違う。
ブリッジ作ったり、Diskイメージ作ったりは他を参照

[prompt ~]# pwd
 /root
[prompt ~]# cat guest01.cfg
#version=RHEL7

install
cdrom
text
cmdline
skipx

lang en_US.UTF-8
keyboard --vckeymap=jp106 --xlayouts=jp
timezone Asia/Tokyo --isUtc --nontp

network  --bootproto=dhcp --device=eth0 --nameserver=8.8.8.8 --noipv6 --hostname=bs-lrepo

zerombr
bootloader --location=mbr

clearpart --all --initlabel
part / --fstype=xfs --grow --size=1 --asprimary --label=root

rootpw --plaintext B1tsurfS$G
auth --enableshadow --passalgo=sha512
selinux --disabled
firewall --disabled
firstboot --disabled

%post
## virsh console ハング回避対応
/bin/echo GRUB_CMDLINE_LINUX=\"vconsole.keymap=jp106 crashkernel=auto vconsole.font=latarchrheb-sun16 console=tty0 console=ttyS0,115200n8r\" > /etc/default/grub
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
%end

reboot

%packages
%end


[prompt ~]# virt-install --name guest01 --hvm --virt-type kvm --ram 4096 --vcpus 2 --arch x86_64 --os-type linux --os-variant rhel7 --boot hd --disk path=/var/lib/libvirt/disk/bs-lrepo.qcow2 --serial pty --console pty --location /var/lib/libvirt/iso/CentOS-7-x86_64-Minimal-1503-01.iso --graphics vnc,port=5902,listen=0.0.0.0,keymap=ja --initrd-inject bs-lrepo.cfg --extra-args "inst.ks=file:/guest01.cfg console=tty0" --noautoconsole
1
1
0

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
1
1