RedHat7—Linux中kickstart自动安装脚本制作

本实验使用虚拟机版本为rhel7,从rhel7后的版本kickstart工具进行收费使用。

1.在VMware关闭dhcp自动获取ip地址功能

2.安装并启动httpd

root@localhost \~\]# yum install httpd

root@localhost \~\]# systemctl start httpd \[root@localhost \~\]#systemctl stop firewalld #关闭防火墙 \[root@localhost \~\]#setenforce 0 #关闭selinux

3.安装图型系统

server with GUI为软件包组

使用yum groups install + 软件包组

root@nginx \~\]# yum groups install "server with GUI" -y

开启主机图像

root@nginx \~\]# init 5

安装图型化生成kickstart的工具

root@localhost \~\]# yum install system-config-kickstart

启动图形制作工具、

root@nginx \~\]# system-config-kickstart

4.进行配置修改

5.记得重新挂载镜像

创建目录rhel7,将镜像挂载到上面

root@localhost \~\]#mkdir /rhel7 \[root@localhost\~\]#mount /dev/sr0 /rhel7

然后将rhel7路径发布到httpd默认目录中

root@localhost wu\]# ln -s /rhel7/ /var/www/html/ \[root@localhost wu\]# cp ks.cfg /var/www/html/ ![](https://i-blog.csdnimg.cn/direct/b5789b86c794444ea071b9525b014dcc.png) httpd默认目录底下存在文件 ![](https://i-blog.csdnimg.cn/direct/bc377d3d2c7d4001a0453af31bf630c8.png) 使用浏览器访问地址:172.25.254.100/rhel7 ![](https://i-blog.csdnimg.cn/direct/62d9a3aab68f49d79a078e4a882eae9e.png) 使用浏览器访问地址:172.25.254.100/ks.cfg ![](https://i-blog.csdnimg.cn/direct/984e0388882b4ca2a7e6d05d6840de79.png) ## 6.搭建dhcp服务kickstart脚本 创建新的虚拟机使用红帽9版本的内核 > \[root@localhost \~\]# yum install dhcp ![](https://i-blog.csdnimg.cn/direct/1aa106068f104811ba118c9a7027a41c.png) 编辑软件的配置文件 > \[root@nginx # rpm -qc dhcp > > \[root@nginx\]# cat /etc/dhcp/dhcpd.conf > > \[root@nginx \]# \\cp -f /usr/share/doc/dhcp\*/dhcpd.conf.example /etc/dhcp/dhcpd.conf 编辑配置文件信息 > \[root@localhost \~\]# vim /etc/dhcp/dhcpd.conf ![](https://i-blog.csdnimg.cn/direct/e69c775a5d8942418bd7a4e2fcfb8bb1.png) ![](https://i-blog.csdnimg.cn/direct/ed1d1b55ae9247db9fab5bb31873544c.png) 更改自己的网络位(172.25.254.0),子网掩码(255.255.255.0)和网关(172.25.254.2) IP地址池(172.25.254.30 172.25.254.40) ![](https://i-blog.csdnimg.cn/direct/2c60944f5ebc4be38c1776dafccca672.png) 启动dhcp > \[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. 创建新的虚拟机 按住Tab键,输入命令 ![](https://i-blog.csdnimg.cn/direct/adff3a4f16a74e2098b6944765cadce5.png)

相关推荐
C_心欲无痕15 分钟前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜6001 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston2 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20182 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟2 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston2 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式2 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode2 小时前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务3 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php
码农小韩4 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法