[Solved]: Network stops working after a CloneVDI / VM
Posted: 7. Jul 2008, 12:54
I cloned an Ubuntu machine, and I've come across this "feature" before, but doing this fix prompted me to raise this note just in case anyone else has this problem.
A feature of all Debian derivative OSs including Ubuntu is that it uses the udev to build the /dev tree during bootup. See man udev for more details. udev uses the files in /etc/udev/rules.d/ to tell it how to build the device tree. The file that we're interested in is 70-persistent-net.rules. When you first configure your VM, a MAC address is generate, say 08:00:27:12:34:56, and the following lines get automatically added to the file during the first boot sequence:So you now clone your Image, register it, create a new VM and set the VM's disk to be the clone. However the new VM now has a different MAC address , say 08:00:27:23:45:67, so the first time you boot this "new" NIC card gets added to the list:The only trouble with this is that the VM is presenting 08:00:27:23:45:67 as the first NIC so udev gets confused and when your machine boots you end up with no network visible.
The solution is to edit this file (in sudo) to delete the first entry and rename the second to eth0. You'll find that eth0 is then recognised properly on reboot.
A feature of all Debian derivative OSs including Ubuntu is that it uses the udev to build the /dev tree during bootup. See man udev for more details. udev uses the files in /etc/udev/rules.d/ to tell it how to build the device tree. The file that we're interested in is 70-persistent-net.rules. When you first configure your VM, a MAC address is generate, say 08:00:27:12:34:56, and the following lines get automatically added to the file during the first boot sequence:
Code: Select all
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:12:34:56", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Code: Select all
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:12:34:56", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:23:45:67", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
The solution is to edit this file (in sudo) to delete the first entry and rename the second to eth0. You'll find that eth0 is then recognised properly on reboot.