安装虚拟机脚本
实验环境 1.火墙 selinux关闭 setenforce 0
2.配置软件仓库能正常使用
3.httpd服务开启
vim /root/anaconda-ks.cfg(按如下更改)
openssl passwd -6 设置密码加密字符
把加密字符写入/root/anaconda-ks.cfg
cp /root/anaconda-ks.cfg /var/www/html/westos.ks
chmod 644 /var/www/html/westos.ks
#version=RHEL8
#ignoredisk --only-use=sda
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Reboot after installation
reboot
# Use graphical install
#graphical
text
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8 --addsupport=zh_CN.UTF-8
# Network information
network --bootproto=dhcp --onboot=on
repo --name="AppStream" --baseurl=http://172.25.254.250/rhel8.2/AppStream
# Use network installation
url --url="http://172.25.254.250/rhel8.2"
# Root password
rootpw --iscrypted $6$hKx3uiCepklshu3r$yGUk4WtNzGdQsQhY71TCaW0tmABnQw9CtK8IbMH54cIDguvUAu5BaW9KwnPxWQ51mkQ1hK13fX/mwYVNHdWZW/
# X Window System configuration information
xconfig --startxonboot
firstboot --disable
# System services
services --enabled="chronyd"
# System timezone
timezone Asia/Shanghai
# Disk partitioning information
part / --fstype="xfs" --size=1 --grow
part /boot --fstype="xfs" --size=500
part swap --fstype="swap" --size=500
%packages
@^graphical-server-environment
ibus-libpinyin.x86_64
%end
virt-manager
添加虚拟机
设定完硬盘内存大小虚拟机名字后
Troubleshooting+Tab
ks=http://172.25.254.39/westos.ks
安装完成