Virtualbox copying CentOS virtual machines cannot be connected to the Internet

Source: Internet
Author: User

Virtualbox copying CentOS virtual machines cannot be connected to the Internet

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.
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.