Muffinresearch Labs by Stuart Colville

Vmware: “SIOCSIFADDR: No such device eth0″ after cloning | 49 Comments

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

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

  • http://sonniesedge.co.uk SonniesEdge

    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.

  • http://alastairc.ac/ AlastairC

    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.

  • http://muffinresearch.co.uk Stuart Colville

    @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.

  • http://www.arabek.net arab

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

    You’re a lifesaver.

  • http://www.piddocke.com Robert

    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.

  • http://www.coldsun.co.cc Lawrence Salmingo

    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

  • Ragnar

    Thank you, the Deb mv saved my day :)

  • http://www.88project.com Ian Hailey

    Many thanks for this, I owe you a beer!

  • modah

    Thanks !!!!!

  • http://whall.org/blog whall

    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.

  • Santa

    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.

  • http://www.fluidscape.co.nz/ Duncan Bayne

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

  • loydb

    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!

  • Pingback: Vmware: “SIOCSIFADDR: No such device eth0″ after cloning « System Howtos and Tutorials

  • Matt

    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

  • piva

    Worked, thank´s a lot.

  • http://capsulasdepalabras.wordpress.com Noé Puyal

    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

  • Pingback: Error eth0 después de clonar con VMWare « Cápsulas de palabras

  • http://muffinresearch.co.uk Stuart Colville

    @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.

  • http://capsulasdepalabras.wordpress.com Noé Puyal

    @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 ^-^

  • Matt

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

  • Deek

    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-”

  • http://blog.codewrench.net PÃ¥l Andreassen

    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.

  • Chris Markle

    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.

  • Maynata

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

  • Jeff

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

  • Nice

    Thanks a lot!!!

  • http://www.akademy.co.uk Matthew

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

  • Juraj

    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

  • Juraj

    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

  • Thibs

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

  • http://muffinresearch.co.uk Stuart Colville

    @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.

  • Joaquin

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

  • pasumon

    Thank you so much. This is very helpful.

  • hawkbat05

    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.

  • experx

    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.

  • LinuxM@n

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

  • prasad

    Thanks a zillion. This worked

  • Slade Swan

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

  • Johnny W

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

  • Terazen

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

  • Pubudu

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

  • Vikram

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

  • Lee Jones

    Thanks for this really helped me out.

    I have renamed the file before I shutdown my VM and then converted it to a template. This seems to work then when I deploy it.

    Great. Thanks again.

  • Pingback: Get the eth0 network working on Raspberry Pi VMWare virtual image! | Trip2Mars.com Raspberry Pi Blog

  • http://www.laquisha.com LaQuisha Redfern

    Wow thank you!

    I remembered a similar thing with a WIN7 virtual machine, but to get the new MAC address to stick in that instance I just made a new virtual network card and WIN recognized it as new hardware.

    You saved my bacon!

    Back to arcane config files foe me now…

  • Josh

    LIFESAVER! Thanks man!

  • Pete

    Lifesaver!

  • Jerrypa09

    And where can i find the file if i have a SUSE vm????

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|(3)

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.576s.