Symptoms:
Centos cannot be connected after it is installed
After the VM is copied, No such device eth0 is displayed.
Three problems we need to solve:
- How to connect to the Internet after installing Centos on Virtualbox
- How to copy and generate a new virtual machine on Virtualbox
- How to connect virtual machines replicated from Virtualbox to the Internet
I. Networking Centos installed on Virtualbox
- Install Centos on a virtual machine
- After installation, set Network Interface Parameters
- Vi/etc/sysconfig/network-scripts/ifcfg-eth0
- Change BOOTPROTO to dhcp.
- Change ONBOOT to yes
- Run service network restart
- Run ifconfig to display Nic information.
- Shutdown-h now shutdown
Ii. Copy and generate a new virtual machine on Virtualbox
- Shut down the VM, right-click the VM icon, and click Copy"
- Set the copy name and re-initialize the MAC addresses of all NICs.
Iii. Networking virtual machines replicated from Virtualbox
Vi/etc/udev/rules. d/70-persistent-net.rules
Comment out eth0 settings
Change eth1 to eth0
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Change the NIC address to the MAC address in Virtual Box. (MAC display method: Right-click the VirtualBox manager and choose system> Settings> network> MAC address)
Restart: reboot
Note:
It is recommended that you complete the preceding steps at one time without any additional steps. For example, if you restart the NIC in the third part, an error may occur. If an error occurs, re-check the above modification. The new version of Virtualbox has the graphic interface copy function, so it is necessary to download the latest version ~
Error:
Device eth1 does not seem to be present: the other steps are correct, but you forgot to restart. Remember to restart.