The first step is to mount the local CD ISO image file to the local FTP directory
Echo/etc/fstab
/root/桌面/ZF-100/nsd/xx/lisi/CLOUD/1/CentOS7-1708.iso /var/ftp/centos7/ iso9660 defaults 0 0
The second step installs the software required to install the KVM
' Yum-y install QEMU-KVM libvirt-daemon libvirt-client Libvirt-daemon-driver-qemu '
Step three Create a new image file
cd/var/lib/libvirt/images/
QEMU-IMG create-f Format disk path size
Qemu-img create-f qcow2 nsd.img 10G #创建指定大小can be set casually
Fourth step using Virsh management technology to create a virtual network card (call DNSMASQ to provide DNS, DHCP and other functions)
Echo/etc/libvirt/qemu/networks/vbr.xml
<network>
<name>vbr</name>
<bridge name= "VBR"/>
<forward mode= "Nat"/>
<ip address= "192.168.1.254" netmask= "255.255.255.0" >
<dhcp>
<range start= "192.168.1.100" end= "192.168.1.200"/>
</dhcp>
</ip>
</network>
virsh#
Net-define Vbr.xml Creating a virtual network
Net-start VBR to start a virtual network
Net-autostart VBR Set VBR virtual network on Start
Fifth step Virt-manager Installing the virtual machine
0.1 start Virt-manager software, select New virtual machine
0.2 Select the network installation source
Ftp://192.168.1.254/centos7
0.3 Click to generate a virtual machine
Select Custom Storage/var/lib/libvirt/images/nsd.img #刚才创建的镜像文件
0.4 Network Select a custom VBR
0.5 software Select Minimal, close KDUMP
– Select Manual Partitioning
0.6 use the standard partition format to divide only one root partition
0.7 opening the installation system
Use KVM technology to create a virtual machine with a Yum source, and be able to connect to the extranet