"Nosuchdeviceeth0" error of Ubuntu After cloning VMWare

Source: Internet
Author: User
Environment: VMWareESX4.0, Ubuntu9.10Server: after creating a VMWare Virtual Machine for Ubuntu locally, copy it, create a new clone image, and start it. The NIC is invalid, and an error "eth0: ERRORwhilegettinginterfaceflags: Nosuchdevice ". The reason is that the NIC mac address of the newly cloned VM image has changed. Open the. vmx file of the VM, ethernet0

Environment: VMWare ESX4.0, Ubuntu 9.10 Server

After creating a VMWare Virtual Machine for Ubuntu locally, copy, create a new clone image, start, the NIC is invalid, and an ERROR "eth0: ERROR while getting interface flags: No such device" is displayed ".

Cause

The mac address of the NIC of the newly cloned virtual machine image has been changed. Open the. vmx file of the VM. The ethernet0.generatedAddress entry records the mac address of the VM.

View All adapter Information

Ifconfig-

In addition to the original eth0, Ubuntu has named the new Nic eth1.
Ubuntu saves the NIC mac address and device name configuration file in

/Etc/udev/rules. d/70-persistent-net.rules

The network configuration of the NIC is saved in

/Etc/network/interfaces
This configuration file only contains the configuration information of the original eth0.
Solution 1
Move/Delete the rules file. (Not verified)
After the restart, Ubuntu will create a new rules file.
Identify the new Nic as eth0 and use the network configuration of the original eth0.
If the network configuration is to automatically obtain the IP address, no additional modifications are required.

Sudo mv/etc/udev/rules. d/70-persistent-net.rules
/Etc/udev/rules. d/70-persistent-net.rules.old

Solution 2

Modify the rules file. (Not verified)

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

The original content is as follows:

# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? *",
ATTR {address }= "00: 0c: 29: 50: xx", ATTR {type }= "1", NAME = "eth0"

# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? *",
ATTR {address} = "00: 0c: 29: 36: xx", ATTR {type} = "1", NAME = "eth1"

Delete the configuration of eth1 and replace the mac address of eth0 with the mac address of eth1.

# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? *",
ATTR {address} = "00: 0c: 29: 36: xx", ATTR {type} = "1", NAME = "eth0"

After the restart, Ubuntu also recognizes the new Nic as eth0, which follows the network configuration of the original eth0.
If the network configuration is to automatically obtain the IP address, no additional modifications are required.

Solution 3

Modify the interfaces file. (Verified)

Sudo pico/etc/network/interfaces

Replace all eth0 with eth1.
If it is a static address, modify the corresponding settings at the same time.

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.