安装虚拟机
1.安装虚拟机
virt-manager
2.封装
1) hostnamectl set-ostname lue.westos.com
2) cd /etc/sysconfig/network-scripts/
vim ifcfg-eth0
BOOTPROTO=none
NAME=westos
IPADDR=172.25.6.1
GATEWAY=172.25.6.250
DNS1=114.114.114.114
DEVICE=eth0
ONBOOT=yes
3)
systemctl disable --now NetworkManager
systemctl stop firewalld
4)
vi /etc/sysconfig/selinux
enforcing------>disabled
5)
vim /etc/hosts
172.25.6.1 westos.westos.com
172.25.6.1 westos
172.25.6.2 lue
172.25.6.3 lue1
172.25.6.4 lue2
172.25.6.5 lue3
172.25.6.6 lue4
172.25.6.7 lue5
172.25.6.8 lue6
6) 挂载
yum install -y httpd
cd /var/www/html
mount /home/kiosk/rhel-server-7.6-x86_64-dvd.iso /var/www/html/rehl7.6
7) 配置repo
vi /etc/yum.repos.d/dvd.repo
[DVD]
name=rehl7.6
baseurl=http://172.25.6.250/rehl7.6
gpgcheck=0
8) poweroff
9)真机
在真机里面
cd /var/lib/libvirt/images/
virt-sysprep -d rhel7.6-lue <清理虚拟机>
qemu-img create -f qcow2 -b rhel7.6-lue.qcow2 vm1 <克隆一个虚拟机>
10)
更改虚拟机名字即可