前置
1.rhel7主机
2.开启主机图形 ,init 5 开图形
3.配置网络可用
4.关闭vmware dhcp功能
实验步骤
1.安装图形化生成kickstart自动安装脚本的工具
[root@localhost ~]# yum install system-config-kickstart -y
2.启动图形制作工具
[root@localhost ~]# system-config-kickstart
3.图形选择
最后点击左上角文件保存到/root即可,默认命名ks.cfg
[root@localhost ~]# ksvalidator ks.cfg
检验ks.cfg文件是否完整
4.下载httpd包,并移动ks文件,生成软连接
[root@localhost ~]# yum install httpd -y
[root@localhost ~]# mv ks.cfg /var/www/html/
[root@localhost ~]# ln -s /rhel7/ /var/www/html/
[root@localhost ~]# ll /var/www/html/
总用量 4
-rw-r--r--. 1 root root 1187 8月 5 17:12 ks.cfg
lrwxrwxrwx. 1 root root 7 8月 5 17:24 rhel7 -> /rhel7/
[root@localhost ~]#
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl start httpd
5.浏览器访问ks.cfg文件
6.安装dhcp服务器为其他服务器提供分配ip的功能
[root@localhost ~]# yum install dhcp -y
#生成配置文件
[root@localhost ~]# \cp -f /usr/share/doc/dhcp*/dhcpd.conf.example
/etc/dhcp/dhcpd.conf
[root@localhost ~]# vim /etc/dhcp/dhcpd.conf #看下图
[root@localhost ~]# systemctl enable --now dhcpd
Created symlink from /etc/systemd/system/multi-user.target.wants/dhcpd.service to /usr/lib/systemd/system/dhcpd.service.
[root@localhost ~]#
修改一下ks.cfg
[root@localhost ~]# vim /var/www/html/ks.cfg
另外克隆一个虚拟机操作
显示全x就是没有问题
7.共享pxelinux.0数据文件的网络服务
[root@localhost ~]# yum install syslinux.x86_64 -y
[root@localhost ~]# yum install tftp-server.x86_64
[root@localhost ~]# systemctl enable --now tftp
Created symlink from /etc/systemd/system/sockets.target.wants/tftp.socket to /usr/lib/systemd/system/tftp.socket.
[root@localhost ~]#
[root@localhost ~]# cp /rhel7/isolinux/* /var/lib/tftpboot/
[root@localhost ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
[root@localhost ~]# cd /var/lib/tftpboot/
[root@localhost tftpboot]# mkdir pxelinux.cfg
[root@localhost tftpboot]# cp isolinux.cfg pxelinux.cfg/default
编辑/etc/dhcp/dhcpd.conf
[root@localhost tftpboot]# vim /etc/dhcp/dhcpd.conf
编辑 pxelinux.cfg/default
[root@localhost tftpboot]# vim pxelinux.cfg/default
重启服务
[root@localhost tftpboot]# systemctl restart tftp
[root@localhost tftpboot]# systemctl restart dhcpd
在另外虚拟机开机选择 打开电源时进入固体
回车即可
全部显示x基本完成了