Solve the problem that eth0 does not exist after cloning the Linux Virtual Machine on Vmware.

Source: Internet
Author: User

ArticleAuthor:SlyarSource: slyar home (Www.slyar.comFor more information, see. Thank you for your cooperation.

I copied a copy of the Ubuntu server VMware vmdk that I configured to my girlfriend. Ubuntu created with this virtual hard disk can also be used on her computer. The only problem is that the NIC cannot be found, prompt "No such device eth0 "...

It took me several hours to solve the problem...

The reason is that the hardware configuration file saved by VMware *. in vmx, the MAC address of the NIC is recorded, while in Ubuntu, the MAC address is also recorded. In this way, when cloning a VM, VMWare assigns a new eth0 Nic to Ubuntu, however, because it is occupied by the previous eth0, it will become eth1. The error message "No such device eth0" is displayed because eth0 is the default Nic and does not exist "..

The configuration file for saving the MAC address in Ubuntu is "/etc/udev/rules. d/70-persistent-net.rules". I installed version 9.10, and Versions later than 8.04 should all adopt this solution:

Method 1: Delete the configuration file directly.

Directly Delete the configuration file. After the restart, UBUNTU will find the new Nic.

Sudo RM/etc/udev/rules. d/70-persistent-net.rules

Method 2: modify the configuration file

Modify the configuration file, delete the original eth0, and then change eth1's name = "erh1" to name = "eth0". After the restart, UBUNTU will use the new configuration file to set the NIC.

Before modification, the/etc/udev/rules. d/70-persistent-net.rules is as follows:

# PCI device 0x1022: 0x2000 (pcnet32)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 50: XX ", ATTR {dev_id} =" 0x0 ", ATTR {type} = "1", kernel = "ETH *", name = "eth0"

# PCI device 0x1022: 0x2000 (pcnet32)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 85: XX ", ATTR {dev_id} =" 0x0 ", ATTR {type} = "1", kernel = "ETH *", name = "eth1"

Modify it:

# PCI device 0x1022: 0x2000 (pcnet32)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 85: XX ", ATTR {dev_id} =" 0x0 ", ATTR {type} = "1", kernel = "ETH *", name = "eth0"

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.