Article directory
Why clone
-
First of all, virtual machines created on VMware can be reused. The installed virtual machine can be copied or cut directly to any other computer, and then opened and used using VMware. The virtual machine settings and login passwords of the two are exactly the same.
-
Because you need to build clusters during development, such as redis clusters, kafka clusters, microservice clusters, etc., in order to be more realistic, you need multiple virtual machines. Use one VMware to open multiple virtual machine systems. You can of course recreate them at this time. Virtual machines, or copying virtual machines, are not as fast as cloning virtual machines.
-
Cloning a virtual machine only takes a few simple steps to clone an identical system. The virtual machine configuration, login account and password are exactly the same. More importantly, even the programs installed on the original system can continue to be used in the newly cloned system. .
1. Environmental inspection
- First check what is on the current server before cloning
192.168.204.130
This machine has the following information
- Clone environment
VMware version 16.2.4
CentOS version 8.5.2
2. Start cloning
- First, take the one you want to clone
虚拟机关机
- Select the created virtual machine [
右键 - 管理 - 克隆
], next step - next step
- Create a snapshot of a full clone
virtual-002
Rename and store the cloned virtual machine
- Complete cloning
- Newly cloned
3. Static configuration of network card
This is also the most important step, success or failure depends on it.
- Detailed configuration can be found in the fourth step of the detailed tutorial for installing CentOS8 on a VMware virtual machine , network configuration.
- First, check the IP.
nmcli
You can see here that the IP of the previous server is the same. It must be modified, otherwise the two cannot be started at the same time. - Enter
/etc/sysconfig/network-scripts/
the directory [usually the first one] and use tovi
edit the file - Enter
i
to enter insert mode andBOOTPROTO=DHCP
change toBOOTPROTO=static
#开机加载网络配置启动网络服务
ONBOOT="yes"
#分配ip的协议 none static :不自动分配,手动设置ip / dhcp:动态分配ip
OOTPROTO=static
#手动指定的ip
IPADDR=192.168.204.131
#网络掩码
NETMASK=255.255.255.0
#网关
GATEWAY=192.168.230.10
#连接外网时解析域名使用, 如果不配置不能连接外网
DNS1=8.8.8.8
- After editing, refresh the network configuration
nmcli device reapply ens160
- Check whether it is a static IP [After refreshing the network card configuration file, the configuration will not take effect. You need to use the reboot command to restart the static IP to take effect]