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.