The biggest advantage of using a virtual machine is that the virtual machine files can be copied to another machine, and colleagues can quickly clone multiple virtual machines from one virtual machine as the source. I often use this method when building some cluster solutions this year, but I also encountered some problems. Here is a list:
1.Unable to connect to the network after Replication.
If we useIfconfigCommand to view the system network configuration, you will find that no Nic is activated, usually shown:
But if we use the commandIfconfig-View, usually see an inactive network card, the general name is eth1, of course, it may also be eth2 or eth3.
If the network card name of the source machine we copied is eth0, eth1 is usually displayed here. If the source machine is eth1, eth2 is generally used here. This is the NIC automatically generated after the VM is copied, and the address is changed. To activate this new Nic, We must configure it.
First jump to the network configuration directory:
CD/etc/sysconfig/network-scripts/
Then ls will see the file ifcfg-eth0, this is the source machine Nic configuration file, we need to add a configuration file to start the new Nic.
CP ifcfg-eth0 ifcfg-eth1
VimIfcfg-eth1
The edited content is generally as follows:
Device ="Eth0"
Hwaddr ="00: 0C: 29: 97: 82: A0"
Bootproto = DHCP
Nm_controlled = "yes"
Onboot = "yes"
you need to edit the highlighted blue part. The first part is changed to Nic name . Change the second to physical address , and then exit WQ. Run the following command to restart the network:
/etc/init. d/network restart
and run the ifconfig command to check whether the eth1 Nic has an IP address, if you do not have one, you can reboot and restart the machine.