HOWTO: Renew NIC MAC address in Ubuntu Linux for copied VMware guest image

Technical

When a VMware image is copied, VMware server (and other VMware products) will ask if the image is copied or moved.  For any reasons, if you answered “copied”, then the MAC address for the virtual NIC will be changed.

In Ubuntu (I am using 10.04.2 LTS Lucid), look for a file named /etc/udev/rules.d/70-persistent-net.rules and edit the corresponding entries for the “added” NIC (this is because the OS just thought you add a new NIC). e.g.

Look for:

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:0c:29:26:f5:f1″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1

and change it to:

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:0c:29:26:f5:f1″, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0