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)

相关推荐
威迪斯特32 分钟前
CentOS图形化操作界面:理论解析与实践指南
linux·运维·centos·组件·图形化·桌面·xserver
一方热衷.38 分钟前
在线安装对应版本NVIDIA驱动
linux·运维·服务器
独自归家的兔41 分钟前
ubuntu系统安装dbswitch教程 - 备份本地数据到远程服务器
linux·运维·ubuntu
m0_6948455742 分钟前
tinylisp 是什么?超轻量 Lisp 解释器编译与运行教程
服务器·开发语言·云计算·github·lisp
ONE_SIX_MIX44 分钟前
ubuntu 24.04 用rdp连接,桌面黑屏问题,解决
linux·运维·ubuntu
龙飞0544 分钟前
Systemd -systemctl - journalctl 速查表:服务管理 + 日志排障
linux·运维·前端·chrome·systemctl·journalctl
*小海豚*1 小时前
在linux服务器上DNS正常,但是java应用调用第三方解析域名报错
java·linux·服务器
June`1 小时前
muduo项目排查错误+测试
linux·c++·github·muduo网络库
春日见1 小时前
如何创建一个PR
运维·开发语言·windows·git·docker·容器
DARLING Zero two♡1 小时前
告别 Docker 命令行!Portainer+cpolar 让容器管理从局域网走向公网
运维·docker·容器