The CentOS Virtual Machine replicated by Virtualbox cannot be connected to the Internet.

Source: Internet
Author: User

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:
  1. How to connect to the Internet after installing Centos on Virtualbox
  2. How to copy and generate a new virtual machine on Virtualbox
  3. How to connect virtual machines replicated from Virtualbox to the Internet
I. Networking Centos installed on Virtualbox
  1. Install Centos on a virtual machine
  2. After installation, set Network Interface Parameters
  3. Vi/etc/sysconfig/network-scripts/ifcfg-eth0
  4. Change BOOTPROTO to dhcp.
  5. Change ONBOOT to yes
  6. Run service network restart
  7. Run ifconfig to display Nic information.
  8. Shutdown-h now shutdown
Ii. Copy and generate a new virtual machine on Virtualbox
  1. Shut down the VM, right-click the VM icon, and click Copy"
  2. 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.

Related Article

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.