# menu background splash.jpg # 菜单背景等
menu title Welcome to CentOS 6.4!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label CentOS6_PXE
menu label ^PXE Install CentOS KVM
kernel /CentOS6/vmlinuz
append ks=ftp://192.168.80.131/ks.cfg initrd=/CentOS6/initrd.img
label rescue
menu label ^Rescue installed system
kernel /CentOS6/vmlinuz
append initrd=/CentOS6/initrd.img rescue
# cat /var/ftp/ks.cfg
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disabled
skipx
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use network installation
url --url=ftp://192.168.80.131/centos
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$duSkJ1$1P5qGnqUGn3S1MTTFiPJY.
# SELinux configuration
selinux --disabled
# System timezone
timezone Asia/Shanghai
# Install OS instead of upgrade
install
# Disk partitioning information
part /boot --asprimary --bytes-per-inode=4096 --fstype="ext3" --size=100
part / --bytes-per-inode=4096 --fstype="ext3" --size=5000
part swap --bytes-per-inode=4096 --fstype="swap" --size=512
Address to listen on for VNC/Spice connections. Default is typically 127.0.0.1
(localhost only), but some hypervisors allow changing this globally
(for example, the qemu driver default can be changed in /etc/libvirt/qemu.conf).
Use 0.0.0.0 to allow access from other machines. This is use by ’vnc’ and ’spice.
virsh # list # 显示运行或者暂停的Guest
Id Name State
----------------------------------------------------
28 centos6_1 running
virsh # list --all # 显示所有的Guest,包括状态为shut off的
Id Name State
----------------------------------------------------
28 centos6_1 running
- centos shut off
virsh # console centos6_1 # console方式连接Guest
Connected to domain centos6_1
Escape character is ^] # 使用Ctrl+]即可退出
CentOS release 6.4 (Final)
Kernel 2.6.32-358.el6.x86_64 on an x86_64
virsh # list
Id Name State
----------------------------------------------------
28 centos6_1 running
32 centos running
virsh # shutdown centos
# 关闭某个Guest,这里一定要注意,如果Guest没有安装运行acpid服务,
# 则此方式失效,可以kill强制关闭,或者console/ssh连接执行关闭
Domain centos is being shutdown