Enterprise virtual machine package

Virtual machine package

  • Principle encapsulation virtual machine
    to a virtual machine configured to something like an installation package can be quickly replicated a plurality of virtual machines installed by saving time and ease of use.
  • redhat7.3 version of the virtual machine package

Switch to the root user
virt-manager to open the virtual machine management interface
click on the upper left corner

Here Insert Picture Description
Mirroring installation:

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description

To install the virtual machine from the master disk names:
Here Insert Picture Description

Here Insert Picture Description

Select Language:
Here Insert Picture Description
Here Insert Picture Description
Select time zone
Here Insert Picture Description

Set to start the installation is complete, you can choose whether to install the graphics needed
Here Insert Picture Description
to set the root password and create a user:
Here Insert Picture Description
Here Insert Picture Description

Wait for the installation, the installation is complete click reboot
Here Insert Picture Description

The system of non-graphical interface:
Log in as root and modify the host name

Here Insert Picture Description
Use ifconfig command found that the use unsuccessful
use ip addr show command to view the card name
vi /boot/grub2/grub.cfg ## modify the network card name

Here Insert Picture Description
After the addition of net.ifnames line 99 = 0

Here Insert Picture Description

Restart to take effect:

Here Insert Picture Description

Set ip:
Here Insert Picture Description

Here Insert Picture Description

Restart network services, see the ip:
Here Insert Picture Description
set source yum, yum need to mount a good source of rhel7.3 ahead of the real machine
mount point in setting up shared yum source of real machine in:

  /var/www/html/         #系统中默认的发布目录
  mkdir     /var/www/html/westos      #创建默认的挂载目录
  mount    /home/kisok/Desktop/ rhel-server-7.3-x86_64-dvd     /var/www/html/westos           #将镜像挂载在这个目录下。
  vim /etc/rc.d/rc.local       #设置镜像永久挂载点
  内容:mount    /home/kisok/Desktop/ rhel-server-7.3-x86_64-dvd     /var/www/html/westos 
  chmod +x  /etc/rc.d/rc.local    #给文件添加可执行权限
  df       #查看是否挂载

Provided master source yum:
Here Insert Picture Description
Here Insert Picture Descriptionsetting is the view, and some common commands to install, service, after the installation can be selected according to their needs

Here Insert Picture Description
See if you can use the command ifconfig
close NetworkManager and firewalld Service

Here Insert Picture Description
Edit the configuration file vim / etc / sysconfig / selinux
set selinux is disabled

Here Insert Picture Description
The local resolver settings

Here Insert Picture Description
Here Insert Picture Description
Software installed on the real machine clears master cache

yum whatprovides * / virt_sysprep # Find virt_sysprep installation package
yum libguestfs-tools-c-1.32.7-3.el7.x86_64 -y # install

poweroff late mother master cache clear real machine
virt-sysprep -d rhel7-base

Here Insert Picture Description
In the virtual machine manager to remove the master, should not delete files qcow2

Here Insert Picture Description
Create a snapshot according to their needs:
to enter the directory to create a snapshot to create a snapshot: cd / var / lib / libvirt / images /

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/Y950904/article/details/92594350