pxe 网络引导安装
在rhel6中用基于内核的虚拟化,kvm。每次作虚拟机时都手动安装,还要找镜像文件,这在本机上都有,谈不上麻烦,但是如果和我同一内网的同学也想装系统,该怎么办?做一个pxe网络安装引导这个解决办法值得一提。
准备工作:
系统环境:RHEL6 x86_64 iptables disabled 我的ip是192.168.0.12
需要安装包:dhcp tftp-server httpd kickstart
1.#yum install dhcp httpd tftp-server -y
这里通过httpd服务来共享rhel6的安装源(当然也可以用ftpd服务)
mount -o loop rhel6.iso /var/www/html/rhel6
chkconfig htttpd on
/etc/init.d/httpd start
2.kickstart 制作安装ks.cfg 文件,保存到/var/www/html/ (这里不再介绍了。百度很多)
3.配置 tftp 服务:
cp /var/www/html/rhel6/isolinux/* /var/lib/tftpboot
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
vi /var/lib/tftpboot/pxelinux.cfg/default
.....
label linux
menu label Install rhel6 system
menu default
kernel vmlinuz
append initrd=initrd.img ks=http://192.168.0.12/ks.cfg
label rescue
menu label Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
chkconfig tftp on
service xinetd start
4.配置 dhcp 服务:
cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
vi /etc/dhcp/dhcpd.conf
option domain-name "example.com";
option domain-name-servers 192.168.0.254;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.20;
option routers 192.168.0.12;
}
filename "pxelinux.0";
next-server 192.168.0.12;
chkconfig dhcpd on
service dhcpd start
OK pxe网络安装引导做好了。动手试试。。。