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/

httpd默认目录底下存在文件

使用浏览器访问地址:172.25.254.100/rhel7

使用浏览器访问地址:172.25.254.100/ks.cfg

6.搭建dhcp服务kickstart脚本

创建新的虚拟机使用红帽9版本的内核

root@localhost \~# yum install dhcp

编辑软件的配置文件

[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

更改自己的网络位(172.25.254.0),子网掩码(255.255.255.0)和网关(172.25.254.2)

IP地址池(172.25.254.30 172.25.254.40)

启动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键,输入命令

相关推荐
资讯第一线8 分钟前
斐讯R1免登录配网》 [APP] [安卓版] 下载
运维
ONLYOFFICE12 分钟前
ONLYOFFICE成为Linux操作系统 – Winux的预装办公套件
linux·运维·服务器
其实防守也摸鱼14 分钟前
OpenClaw Windows 踩坑实战指南
运维·服务器·数据库·windows·github·copilot
mounter62517 分钟前
从内核安全到可编程基础设施:Meta 的 eBPF 实践与形式化验证探索
linux·ebpf·linux kernel·kernel
新时代牛马21 分钟前
嵌入式 Linux WiFi 框架完整篇:从cfg80211、mac80211 到wpa_supplicant
linux·运维·服务器
吴声子夜歌28 分钟前
Linux命令——打印
linux·运维·服务器
Jae den29 分钟前
负载均衡到底解决什么问题?
运维·负载均衡
企鹅的蚂蚁32 分钟前
Linux 开发板串口调试:picocom 从识别到退出的完整用法
linux·运维·服务器
山岚的运维笔记41 分钟前
mysql 专业笔记 -- 第 17 章:连接:连接三个具有相同名称 ID 的表
运维·数据库·笔记·后端·学习·mysql·dba
bksczm1 小时前
从 “什么是 MySQL“ 到库与表的完整操作(MySQL基础篇)
linux·数据库·mysql