用VMware体验无人值守安装RHEL 6(1)


最近下载了一个正式版的RHEL 6,并且在VMware测试了一下使用Kickstart无人值守安装。下面为方法和步骤:

方法:FTP+TFTP+DHCP+Kickstart+PXE

准备两台虚拟机,一台作为测试环境RHEL 6,IP为192.168.0.100),另一台作为RHEL 6被安装端。

一.安装所需要的服务及修改相应配置文件:

1.我用yum来安装所需要的软件包,先来搭建yum光盘源:

[root@localhost ~]# mount /dev/cdrom /mnt

在/etc/yum.repos.d目录下创建一个以.repo结尾的文件:

[root@localhost ~]# vi /etc/yum.repos.d/serverl.repo

配置内容如下:

2.安装vsftpd及开启服务:

[root@localhost ~]# yum -y install vsftpd
[root@localhost ~]# service vsftpd start

3.安装TFTP,修改tftp配置文件及开启服务:

[root@localhost ~]# yum -y install tftp
[root@localhost ~]# yum -y install tftp-server
[root@localhost ~]# vim /etc/xinetd.d/tftp

[root@localhost ~]#service xinetd restart

来验证一下tftp的端口是否开启:

OK,没问题了!

4.安装dhcp,修改配置文件及开启服务:

[root@localhost ~]#yum -y install dhcp

建立配置文件:

修改配置文件:

[root@localhost ~]#vi /etc/dhcp/dhcpd.conf

下面是配置文件截图,需要作添加和修改的地方用红框标注出来了

[root@localhost ~]#service dhcpd restart  

二.配置使用PXE启动所需的相关文件:

[root@localhost ~]#mkdir /tftpboot
[root@localhost ~]#mkdir /tftpboot/pxelinux.cfg
[root@localhost ~]#cp /usr/share/syslinux/pxelinux.0 /tftpboot/
[root@localhost Packages]# cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
[root@localhost Packages]# cp /mnt/images/pxeboot/initrd.img /tftpboot/
[root@localhost Packages]# cp /mnt/images/pxeboot/vmlinuz /tftpboot/
[root@localhost Packages]# chmod 644 /tftpboot/pxelinux.cfg/default
[root@localhost Packages]# vim /tftpboot/pxelinux.cfg/default

下列为default文件截图,添加一处即可红色部分标出)


相关内容