1、安装
在virt-manager里新建一个虚拟机
2、更改主机名
hostnamectl set-ostname westos.com
3、设定网络
cd /etc/sysconfig/network-scripts/
vim ifcfg-eth0
BOOTPROTO=none
NAME=westos
IPADDR=172.25.7.1
GATEWAY=172.25.7.250
DNS1=114.114.114.114
DEVICE=eth0
ONBOOT=yes
4、关闭防火墙
systemctl disable --now NetworkManager
systemctl stop firewalld
5、关闭selinux
vi /etc/sysconfig/selinux
enforcing------>disabled
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled #将enforcing修改为disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
6、配置解析文件host
cd /etc
vi hosts
27.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.25.7.250 westos
172.25.7.1 server1
172.25.7.2 server2
172.25.7.3 server3
172.25.7.4 server4
172.25.7.5 server5
172.25.7.6 server6
172.25.7.7 server7
172.25.7.8 server8
7、挂载镜像
mount /home/kiosk/Desktop/rhel-8.0-x86_64-dvd.iso /westos
mount: /westos: WARNING: device write-protected, mounted read-only.
yum install -y httpd
mount /home/kiosk/Desktop/rhel-server-7.6-x86_64-dvd.iso /var/www/html/rhel7.6
8、 配置repo
vi /etc/yum.repos.d/dvd.repo
[DVD]
name=rehl7.6
baseurl=http://172.25.6.250/rehl7.6
gpgcheck=0
9、关闭电源后在真机中进行克隆:
cd /var/lib/libvirt/images/
virt-sysprep -d rhel7.6-lue #清理虚拟机
qemu-img create -f qcow2 -b rhel7.6-lue.qcow2 vm1 #克隆虚拟机