Muffinresearch Labs by Stuart Colville

Vmware: “SIOCSIFADDR: No such device eth0″ after cloning | 56 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

  • Jprzedworski

     In OpenSuse the file is in the same location like in Ubuntu.

  • http://twitter.com/ooooak Akshay Deep

    thanks

  • http://twitter.com/ooooak Akshay Deep

    login as root

  • http://www.facebook.com/people/Sugar-Ui/100001768970179 Sugar Ui

    I tried method 1, Thanks for tips. However, the “inet addr” information line was not refreshed, but just gone away T_T What can I do now, can someone help me? (I’m win7 64bit user and this happen while running Bitnabi LAMP on the Virtualbox, Ubuntu 64bit)

  • Sanyam Jain

    i tried the method 1 then restart the system (as network restart still don’t work) then it works for me thanks man… you rocked

  • Nadia

    I tried method 1 and it worked like a charm..cheers!

Insert a tab character in vim when expand tabs is on|(0)

I have vim set-up to use spaces in place of tabs. Sometimes you need to use an actual tab e.g. editing a Makefile. Now whilst it’s possible to change settings so that tabs are used for specific files, a quick tip to remember is to simply type in insert mode:

Ctrl+v tab

That is Ctrl and “V” and hit the tab key, et voila you’ve entered an actual tab.

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

Photos on Flickr

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