Muffinresearch Labs by Stuart Colville

Vmware: “SIOCSIFADDR: No such device eth0″ after cloning | Comments (43)

Posted in Code, Linux/Unix on 13th July 2008, 2:38 pm by Stuart

After cloning a vmware image to copy to my local machine I had an issue with eth0 not coming up on an Ubuntu VM.

After a bit of googling I found a solution that required editing /etc/ftab to remove an incorrect generated mac address. Hardy Heron doesn’t have this file though so I did a bit more searching around the filesystem and found a reference to the mac address stored in the vmx (vmware config) file found in /etc/udev/rules.d/70-persistent-net.rules. Note: For Debian the file can be found at /etc/udev/rules.d/z25_persistent-net.rules

Method One – delete the rules file

Quickest way to solve this is to move/delete the rules file. (Thanks to the comment from SonniesEdge.)

# Ubuntu
sudo mv /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules.old

#Debian
sudo mv /etc/udev/rules.d/z25_persistent-net.rules /etc/udev/rules.d/z25_persistent-net.rules.old

Method Two – edit the rules file

The second way is to comment out the line relating to eth0 which had the wrong mac address and replaced “eth1″ with “eth0″. After rebooting eth0 should be working properly and normality will be restored.

Here’s an example carried out on Ubuntu.

The old /etc/udev/rules.d/70-persistent-net.rules looked like this:

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

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

Was edited to look like this:

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

Post Tools

Comments: Add yours

1. On August 5th, 2008 at 9:12 am SonniesEdge said:

I’ve found that it’s a lot easier to just delete 70-persistant-net.rules and then reboot the newly-cloned machine. Ubuntu will recreate the file with no problem.

2. On August 9th, 2008 at 10:37 am AlastairC said:

I think this may also help if you transfer a VM from OSX fusion to windows VMware player. I haven’t testing it yet, but I had trouble with eth0 when trying an debian VM on windows.

3. On October 1st, 2008 at 9:11 am Stuart Colville said:

@SonniesEdge: Thanks I’ve updated the post

@AlastairC: Yep indeed this does work for VMWare Fusion I’ve just had exactly that error with Debian.

4. On October 5th, 2008 at 5:07 pm arab said:

Thanks! Saved me a lot of trouble. I had the same problem after cloning one machine.

You’re a lifesaver.

5. On October 18th, 2008 at 6:58 pm Robert said:

Thanks a bunch. Great and precise post that saved me a lot of trouble. I encountered this problem after moving a Virtual Machine from a Windows VMWARE Server 2 environment to a Ubuntu Linux environment.

6. On November 5th, 2008 at 4:53 pm Lawrence Salmingo said:

Thanks so much! Tip #1 Saved my image as I am about to … good thing you had it here! will link this to my site :D

7. On December 10th, 2008 at 2:04 pm Ragnar said:

Thank you, the Deb mv saved my day :)

8. On January 28th, 2009 at 7:15 pm Ian Hailey said:

Many thanks for this, I owe you a beer!

9. On January 29th, 2009 at 10:58 pm modah said:

Thanks !!!!!

10. On February 2nd, 2009 at 6:53 pm whall said:

Any tips on what to do if you remove/move the file and it does NOT rebuild it?

In my case, I installed a new VA-LAMP from virtualappliances.net. I did some config and customization
- installed rcconf
- disabled apache, lighthttpd, mysql, php
- changed root password
- shutdown

then I used vmware converter to create a new .OVF locally on my PC. Then I used vmware converter to re-upload the .OVF and create a new image with a new name.

now there’s no eth0. I tried uninstalling/reinstalling vmware tools, removing the persistent-net.rules file, rebooting, removing and re-adding the network card from ESXi and I still can’t get any network on the box.

dmesg shows no eth0 or eth1 lines.

I wonder if it’s a MAC address problem because it came from and went to the same ESXi box, but I’m not sure how to troubleshoot that.

11. On February 17th, 2009 at 7:22 pm Santa said:

This really helped me! Thanks thousandtimes. For others, my configuration: Windows XP running on AMD Athlon 64, Ubuntu server 7.10 running on vmware player.

12. On March 29th, 2009 at 9:36 am Duncan Bayne said:

Thank you, thank you, thank you! My configuration: Ubuntu 8.04 Server LTS running on VMWare Desktop 6.0.

13. On July 8th, 2009 at 8:51 pm loydb said:

Thanks for this, saved my sanity. I moved a Workstation 6.5 VM (latest Ubuntu) from my desktop to my laptop, and eth0 and eth1 stopped working. I deleted the rules file, and everything was fine after a reboot!

14. On October 14th, 2009 at 6:13 am Vmware: “SIOCSIFADDR: No such device eth0″ after cloning « System Howtos and Tutorials said:

[...] Ubuntu : View interface: ifconfig -a Edit /etc/udev/rules.d/70-persistent-net.rules. Ref: http://muffinresearch.co.uk/archives/2008/07/13/vmware-siocsifaddr-no-such-device-eth0-after-cloning... [...]

15. On October 27th, 2009 at 9:22 pm Matt said:

This worked great for me also. Ubuntu 8.10/Esxi 3.5-U4
Just because I’m curious, I’m wondering if there’s a way to get rid of the resulting error message that now comes up during startup:

cifs vfs: error connecting to ipv4 socket. aborting operation
cifs vfs: cifs_mount failed w/return code = -113

16. On October 28th, 2009 at 2:51 pm piva said:

Worked, thank´s a lot.

17. On February 9th, 2010 at 8:24 am Noé Puyal said:

Good morning Stuart
Your post has been the most helpful one I’ve found about my issue, even between the official vmware forums. I would like to translate your post for those who understand spanish in my blog. Do you give me your permission?
Thanks

18. On February 9th, 2010 at 8:38 am Error eth0 después de clonar con VMWare « Cápsulas de palabras said:

[...] http://muffinresearch.co.uk/archives/2008/07/13/vmware-siocsifaddr-no-such-device-eth0-after-cloning... Dejar un comentario [...]

19. On February 9th, 2010 at 9:09 am Stuart Colville said:

@Noé Puyal – You’d be more than welcome! Let me have the link when you’ve done it and I’ll link to it from here.

20. On February 9th, 2010 at 10:55 am Noé Puyal said:

@Stuart Colville – I’ve just finished translating the guide, the url is the trackback from Cápsulas de Palabras -> http://capsulasdepalabras.wordpress.com/2010/02/09/error-eth0-despues-de-clonar-con-vmware/
Thanks for your help and your quick response ^-^

21. On February 10th, 2010 at 5:27 pm Matt said:

Thanks son much for your post, i experienced this exact problem when cloning a Ubuntu 9.04 VM on VMware workstation 6.5

22. On February 13th, 2010 at 5:55 am Deek said:

READ THIS VMUSERS!!!
You can all any e1000 network card to be assigned to eth0. This makes for easy configuration when copying vmsessions.

edit
/etc/udev/rules.d/70-persistent-net.rules

remove this part completly save and reboot:
ATTR {address}==”00:0c:29:30:xx:xx”,

OLD:
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR
{address}==”00:0c:29:30:xx:xx”, ATTR{type}==”1″, NAME=”eth0″

NEW:
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{type}==”1″, NAME=”eth-”

23. On July 14th, 2010 at 8:22 pm PÃ¥l Andreassen said:

Thank you very much. This is just as relevant today as it was in 2008. Had huge problems with eth0 not working after cloning an Ubuntu 10.04 VM in ESXi 4.1. Your post saved me from hours of pain.

24. On August 16th, 2010 at 10:28 pm Chris Markle said:

Wanted to add my two bits that this post is still accurate, relevant and fixed my issue. Specifically I had used the VMware Converter to move an Ubuntu VM from one ESXI machine to another. When I booted the new copy I got something along the lines of “SIOCSIFADDR no such device: eth1″. My /etc/network/interfaces on the original system called for lo and eth1 to be brought up. Per this posting, I deleted /etc/udev/rules.d/70-persistent-net.rules and rebooted. Still didn’t quite work as Ubuntu decided that the ethernet interface was eth2. So I just edited the newly-created /etc/udev/rules.d/70-persistent-net.rules and changed eth2 to eth1, rebooted and all was well. (I could have just as well changed /etc/network/interfaces to use eth2 vs. eth1…). Anyway, thanks for the helpful (and still accurate) post.

25. On August 27th, 2010 at 8:52 am Maynata said:

10x Dude! You’re the MAN :) ))

26. On December 7th, 2010 at 2:46 pm Jeff said:

Thanks so much…you are still saving IT lives 2 years after sharing this.

27. On December 11th, 2010 at 5:41 am Nice said:

Thanks a lot!!!

28. On January 6th, 2011 at 12:04 pm Matthew said:

Nice piece of work. Saved me a lot of trouble and more importantly, time!

29. On February 4th, 2011 at 9:43 pm Juraj said:

Hi, i have a problem. i have win7, i installed VMWare and backtrack 4 R1. my problem is, if i write /etc/init.d/networking start

SIOCSIFADDR: no such device
wlan0: ERROR while getting interface flags: No such device
wlan0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
failed to bring up wlan0.
done.

Please, help me, if you know how :)
my pc is Toshiba Qosmio F60/10H, Win7

maybe i did mistake if i installed it. i was looking only on you tube. I am from Slovakia, so try to explain me how can i repair it in normal form :-D .
thanks for all

30. On February 5th, 2011 at 1:11 pm Juraj said:

please,
if i write in Backtrack
/etc/udev/rules.d/70-persistent-net.rules

then

-bash: /etc/udev/rules.d/70-persistent-net.rules: permission denied

what can i do now? thanks

31. On February 7th, 2011 at 12:49 pm Thibs said:

Many MANY Thanks! You helped me, you do not ever imagine!

32. On February 7th, 2011 at 1:41 pm Stuart Colville said:

@Juraj Looking at it Backtrack is based on Slax which I’m not familiar with. However if /etc/udev/rules.d/70-persistent-net.rules exists then you should be able to move it to fix the problem as per the instructions for ubuntu above.

33. On March 6th, 2011 at 10:44 pm Joaquin said:

Thank you so much!!, i was able to save a simple invoice database that i had running on a virtual ubuntu!!

34. On March 26th, 2011 at 3:22 am pasumon said:

Thank you so much. This is very helpful.

35. On May 12th, 2011 at 4:39 pm hawkbat05 said:

I’m so glad I found this! I was ready to scrap the VM and rebuild from a Gentoo Stage3. You saved me a lot of time.

36. On May 15th, 2011 at 3:03 am experx said:

Thank you, don’t know how many instances of VM I have deleted because of this issue. Finally, got some time and took and harder look and found this page. Thanks again.

37. On July 28th, 2011 at 9:55 pm LinuxM@n said:

Thanks a ton man!!! I owe you 2 beers.

38. On August 4th, 2011 at 10:07 pm prasad said:

Thanks a zillion. This worked

39. On August 29th, 2011 at 10:40 am Slade Swan said:

Really appreciate your clear and simple explanation of how to resolve the problem.

40. On September 23rd, 2011 at 8:54 am Johnny W said:

Ran into this problem (Ubuntu 10.04 KVM Cloning) and came upon your site for the solution. Absolutely fantastic article, works perfectly! Cheers Mate!

41. On October 24th, 2011 at 1:45 pm Terazen said:

My server was loading eth2 and the static ip was set for eth0. Renamed the file and rebooted…all problems gone! Thanks!

42. On November 1st, 2011 at 5:42 am Pubudu said:

Thanks a lot. It worked for me. I was clueless as I’m totally new to Linux

43. On January 12th, 2012 at 8:12 pm Vikram said:

Worked for me every single time I have messed…thanks!!!







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(2)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.547s.