Cloning a virtual machine
2015-12-2616:02:10
Preparation phase
first select a virtual machine that already exists. Choose a virtual machine called backup Centos 6
Isolate the backup machine IP and other related information
[Email protected] ~]# Vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Hwaddr=00:0c:29:6a:8b:ce
Type=ethernet
uuid=f16d79ea-7dd5-4cea-8a3f-d688fbcf6a6e
Onboot=yes
Nm_controlled=yes
Bootproto=static
ipaddr=192.168.1.200
netmask=255.255.255.0
gateway=192.168.1.1
dns=8.8.8.8
First, interface cloning
Click on the backup machine and click on the virtual machine menu, virtual machine à manage à clone. Go to the following page
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/7E/wKioL1Z-TfTjieg5AACHJRTdfjk989.png "style=" float: none; "title=" 1.png "alt=" Wkiol1z-tftjieg5aachjrtdfjk989.png "/>
Next
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/78/7F/wKioL1Z-Tj6TFKNSAAA8fPn80JM601.png "title=" 2.png " alt= "Wkiol1z-tj6tfknsaaa8fpn80jm601.png"/>
Next:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/78/80/wKiom1Z-TjiSUblYAACSZZIfCpY572.png "title=" 3.png " alt= "Wkiom1z-tjisublyaacszzifcpy572.png"/>
Complete.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/78/7F/wKioL1Z-TmaCkB3hAACpeUkGAcY127.png "style=" float: none; "title=" 4.png "alt=" Wkiol1z-tmackb3haacpeukgacy127.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/78/80/wKiom1Z-Tk7yeGwSAAB-p577QJM365.png "style=" float: none; "title=" 5.png "alt=" Wkiom1z-tk7yegwsaab-p577qjm365.png "/>
Second, the relevant configuration
To turn on a cloned virtual machine
get an IP from dhclient.
The ping www.baidu.com can then be ping -through. But by Ifconfig you will see the NIC on the clone machine as eth1 instead of the eth0 on our backup machine .
due to The management mechanism of the udev of CentOS, Nic becomes eth1, if we want to change back to Eth0, we can modify it as follows:
cd/etc/udev/rules.d/
Vim 70-persistent-net.rules
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/78/80/wKiom1Z-TmfjX1NaAAKBTCbtkds497.jpg "title=" 6.jpg " alt= "Wkiom1z-tmfjx1naaakbtcbtkds497.jpg"/>
Modify it as shown in the following:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/78/7F/wKioL1Z-Tp3jOeQoAAAsSOYdV5A230.png "title=" 7.png " alt= "Wkiol1z-tp3joeqoaaassoydv5a230.png"/>
You also need to cd/etc/sysconfig/network-scripts modify the ifcfg-eth0 file at this time
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/78/80/wKiom1Z-TpGCtgeHAAAqkkCfOe0663.png "title=" 8.png " alt= "Wkiom1z-tpgctgehaaaqkkcfoe0663.png"/>
Restart Network Service
Service Network restart
At this time, restart the Network service will be error, because the system at the start of the load network card driver is not recognized as eth0 , at this point we have to unload and reload it first.
Modprobe-r e1000
Modprobe e1000
Service Network restart
Restart the Network service again ( If restarting the network service has not become eth0, then reboot the system )
Normally requires a reboot to take effect, after reboot
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/78/7F/wKioL1Z-TsTjHLolAABKTp89R3E134.png "title=" 9.png " alt= "Wkiol1z-tstjhlolaabktp89r3e134.png"/>
The clone is complete.
This article is from the "Do Your best" blog, so be sure to keep this source http://qiaopeng688.blog.51cto.com/3572484/1728579
Cloning a virtual machine