I ran into an annoyance trying to clone some Ubuntu LAMP virtual machines that I was using for website development. Every time I cloned the virtual machine, eth0 would go missing, and ifconfig would show only the loopback device, lo.
It turns out that when you clone a VMware virtual machine, the cloned virtual machine’s network interface gets a new MAC address (which, of course, it must to work on the same LAN). But Ubuntu, and many other Linux distributions, cache the old MAC address in a configuration file.
In Ubuntu, the file is /etc/udev/rules.d/70-persistent-net.rules. After cloning, it will contain a reference to the old network interface as eth0:
The easiest way to fix this problem is to simply delete the file. Ubuntu will regenerate it properly the next time it boots up.
sudo rm /etc/udev/rules.d/70-persistent-net.rules
After deleting the file, you need to reboot. After rebooting, ifconfig should show eth0 and everything should just work.
If you’re feeling less adventurous, you can rename the file to *.old so that you can restore it if something doesn’t work:
sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old
You can also edit the file to remove the old reference to eth0, and rename the new eth1 reference to eth0. But deleting the file and rebooting seems more convenient.
The relevant filename is slightly different in other Linux distributions. For example, in Debian, the filename is /etc/udev/rules.d/z25_persistent-net.rules.


{ 11 comments… read them below or add one }
I used your method to delete the file from my master VM. After shutting it down, I cloned from that state. Every clone would then generate its own udev rule on “first” boot.
@Juan: That’s quite a useful tip.
many thanks :)
You’re welcome. :-)
Thanks. this may be the only place on the web where this solution is noted.
I’ve added a link in my blog to this page.
There is an errata at file path, the full filename is /etc/udev/rules.d/70-persistent-net.rules
Another tip, if you also wish to change the hosname then edit /etc/hostname and /etc/hosts files and replace the old name wuth a new one.
Thanks a lot,
@kklo: Quite right about the filename. I can’t believe It’s been like that so long, and I hadn’t noticed. Now fixed. Thanks!
Thank you very much for the usefull tip. Its worked for me.
thanks a lot! great tip
Many Thanks.
I was baffled to see the eth0 and other interfaces gone when I copied the vmware image. This saved my day.
Ave!
Fantastyczna podpowiedź – zaoszczędziłeś mi tym wpisem mnóstwo żmudnej i mało ciekawej roboty polegającej na sprawdzaniu sieci na systemach gospodarza / gościa jak również samych ustawień VM.
Piękne Ci dzięki. No i super nazwa: “Orzeszek”. :-)
{ 2 trackbacks }