Hacking at Relevance: Agile Development, Consulting and Training

Thursday, January 22

No network after copying an Ubuntu VMWare image

After you copy an Ubuntu image, you'll probably lose your network connectivity. After a little bit of digging, it turns out that Ubuntu persists the MAC address of the network device in /etc/udev/rules.d/*net.rules . The fix:

  sudo rm /etc/udev/rules.d/*net.rules
  sudo shutdown -r now #to reboot

20 comments:

Anonymous said...

Just in case it hepls,rather than having VMware setup to "share" the host network use the vmware network adapter to get the guest to connect directly. The network adapter is one of the icons on the bottom corner of the wmware window.

Guy said...

Thanks, that note saved me a lot of time. :)

Anonymous said...

Thank you very much!
Saved me a ton of hairpulling

Theseven7 said...

Thanks very much, solved my problem now.

Anonymous said...

Thanks dude, that saved my life.

Xenus said...

Great tricks. Therefor I must be not lucky, still not work for me. Its worked partially as I got my eth0 back up, but I still cannot ping any other host... :(

tmft said...

Thanks! This was just what I needed.

tec said...

kudos, I was working around this by adding in a second adapter - this is much better

Bosco So said...

Thanks for the tip - saved me a bit of hair pulling.

I looked a little further into that directory. Turns out the only file you need to remove is 70-persistent-net.rules

So I'd revise your tip as:

sudo rm /etc/udev/rules.d/70-persistent-net.rules
sudo shutdown -r now

Roy said...

saved my ass
*bookmarked*

Anonymous said...

This also worked great for LAMP appliance in VMWare . I believe LAMP is based on Ubuntu. Thank you very much for posting this tip!

Jonathan said...

LAMP isn't based on anything. It stands for a bundle of software, it's an acronym. Linux Apache MySQL PHP. Ubuntu can run LAMP but so can just about every other *nix distro you will come across.

Thanks a bunch for the instruction, saved a bunch of time.

Anonymous said...

Worked great.

Thanks

Anonymous said...

I found this on stackoverflow. Take a look and see if it works for you.

> sudo dhclient eth0

Cheers,

Josh
Boston, MA.
joshmolina.com

Paul said...

Thank you so much for posting! What a stupid bug in vmware, this wasted me hours and i didn't find the fix on their website.

Anonymous said...

Yeeeeees it Heeeeeelp!!!!!1

Bikerpete said...

Maybe more "elegant" way:

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

change the MAC Adress in the line to fit your needs and eventually change the name (example from eth1 to eth0).

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:d8:14:d1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

reboot (or maybe a /etc/init.d/networking restart will do the job)

Greetz
Pete
http://linuxpeter.de
http://battlefieldsecrets.com

Anonymous said...

Thank you so much! You have saved me from a big problem.

Dave said...

3 years on, still saving people time. Excellent work. :o)

Anonymous said...

Saved my day, thanks!