lost and found ( for me ? )

KVM : install CentOS 5.6 as a guest with kicksart

KVM host
# tail -1 /etc/lsb-release

# uname -r

[ preparation ]

- kickstart file
- ISO image
- httpd

I used the following kickstart file.
# cat centos5-6-kvm-ks.cfg
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --append="console=ttyS0,115200n8 console=tty0" --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard jp106
# System language
lang ja_JP
# Installation logging level
logging --level=info
# Use network installation
url --url=
# Network information
network --bootproto=static --device=eth0 --gateway= --ip= --nameserver= --netmask= --onboot=on
# Reboot after installation
#Root password
rootpw --iscrypted $1$o4BvPEzq$CmfSLIJLfURGbGrLlTnOc1

# SELinux configuration
selinux --disabled
# Do not configure the X Window System
# System timezone
timezone --isUtc Asia/Tokyo
# Install OS instead of upgrade
# Disk partitioning information
part / --bytes-per-inode=4096 --fstype="ext3" --size=5000
part swap --bytes-per-inode=4096 --fstype="swap" --size=512


When specifying kickstart file with virt-install , you need to specify http://xxx.
So you need to prepare httpd.
I prepared both CentOS ISO and httpd on the KVM host.

mount ISO image
# mkdir /var/www/centos
# mount -t iso9660 -o loop /var/disk1/ISOs/CentOS-5.6-x86_64-bin-DVD-1of2.iso /var/www/centos

start httpd and copy ks file under http document root. ( in my case , /var/www )
# apache2ctl start
# cp centos5-6-kvm-ks.cfg /var/www/

confirm you can get ks file.
# wget

[ install CentOS 5.6 as a guest VM with virt-install ]

install kvm-pxe if you have not installed.
# apt-get install kvm-pxe

# dpkg -L kvm-pxe

build a VM
# virt-install --connect qemu:///system -n centos5-1 -r 512 –dis
k path=/var/disk1/centos5.5-1.img,size=6 --vcpus=1 --os-type linux --os-variant
rhel5.4 --nographics --location --extra-args='ks=htt
p:// ksdevice=eth0 console=tty0 console=ttyS0,
115200n8' --keymap ja --network bridge=br0 –nographics

the installation has been processed automatically.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.