Skip navigation
VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
29,888 Views 26 Replies Last post: Jan 7, 2011 7:08 PM by rfreytag RSS
1 2 Previous Next
adamsi Lurker 5 posts since
Jun 14, 2006
Currently Being Moderated

Jun 22, 2006 7:06 PM

lost eth0 when using a copied ubuntu-server vm

Hi,

 

I installed an ubuntu-server 6.06 as guest os and every thing is fine. But when I copy the vm to another location on disk, the guest os were not able to find the network adapter and lost its eth0. I ran ifup eth0 but got a "No such device". copy it back to the original directory then everything is ok. I tried changing default vlance to intel pro/1000 and changing NAT to bridged networking, none of them worked. WinXP or Xubuntu desktop don't have this problem. What's wrong? Vmplayer's problem or ubuntu-server's ? Host os is ubuntu-desktop 6.06

 

Adam

kingneutron Master 1,370 posts since
Apr 16, 2005
Currently Being Moderated
1. Jun 23, 2006 2:00 PM in response to: adamsi
Re: lost eth0 when using a copied ubuntu-server vm

When vmplayer complained that the VM's location changed, did you click Keep or Create?

 

After moving/cloning a VM, you should Create a new MAC address for it.  Also:

' less /var/log/messages ' and see if any errors come up with network drivers, eth0, etc.

./. If you have appreciated my response, please remember to apply Helpful/Correct points. TIA
nick.couchman Champion 4,982 posts since
Jan 13, 2006
Currently Being Moderated
3. Jun 26, 2006 6:47 AM in response to: adamsi
Re: lost eth0 when using a copied ubuntu-server vm

On the guest, try "dmesg | grep eth0" and see if there are any messages about the Ethernet device.  If not, try running "modprobe e1000" or "modprobe pcnet32" to see if you can manually load the driver.  Finally, try "ifconfig -a" and see if eth0 is listed in the list of all available network interfaces on the machine.

nome Lurker 1 posts since
Jun 27, 2006
Currently Being Moderated
4. Jun 27, 2006 4:35 AM in response to: nick.couchman
Re: lost eth0 when using a copied ubuntu-server vm

I probably have the same issue.

Copied the guest to a new directory, opened it, created new uuid, and started the new guest.

Dmesg looks ok, eth0 is there (pcnet-something), it is in ifconfig, but can not ifup it.

I thought it could macaddress problem, changed it in the .vmx file, rebooted, and it came up as eth1.

I made another copy of the original, and changing eth0 to eth1 in /etc/network/interfaces made it work after ifup eth1. (probably with the same mac as original guest, if mac isnt changed at the same time as uuid.

 

host and guests are ubuntu 6.06 server.

 

host is standard install , but upgraded (current) yesterday

nick.couchman Champion 4,982 posts since
Jan 13, 2006
Currently Being Moderated
5. Jun 27, 2006 7:42 AM in response to: nome
Re: lost eth0 when using a copied ubuntu-server vm

Some of the newer Linux distributions have a tendency to tie ethernet devices to MAC addresses.  When you generate a new UUID, the MAC address changes, and the distribution doesn't know where to find the interface because the eth0 device that is loaded by the driver differs in MAC address from the device listed in the configuration.  You can try going to /etc/sysconfig/network or /etc/sysconfig/network-scripts and editing the eth0 configuration file.  If a MAC address is listed, compare the MAC address listed in the configuration with the one listed in the ifconfig output.  If they differ, try changing the one in the configuration to match the ifconfig output and reboot.

Stonekeeper Lurker 1 posts since
Jul 14, 2006
Currently Being Moderated
6. Jul 14, 2006 5:13 AM in response to: nick.couchman
Re: lost eth0 when using a copied ubuntu-server vm

Here is a script that should sort you out. I ran into the same problem and this was my way of fixing it. I'm sure it's not the best, but it works. Save it (I called it "fixmac") and put into /usr/sbin/ on your "base machine". Then, after shutting down and copying your base machine, boot the new machine, log in, and execute "fixmac" as root. Reboot and your interface should start working.

 

\---- Start Script -


 

mac=`ifconfig -a | grep "HWaddr" | cut -d " " -f 11`

echo "eth0 mac $mac arp 1" > /etc/iftab

 

\---- End Script -


 

I hope that helps!

Eric_B Lurker 1 posts since
Jul 31, 2006
Currently Being Moderated
7. Jul 31, 2006 12:44 PM in response to: Stonekeeper
Re: lost eth0 when using a copied ubuntu-server vm

I ran into the same problem after copying a Linux vmware image to another location. When I tried to enable the NIC, I received an error message like device eth0 has a different MAC address than expected. The fix was to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file to update the HWADDR line to match the MAC address found in the image's VMX file (the MAC address can be found on the line ethernet0.address=XX:XX:XX:XX:XX:XX).

AndyTakacs Lurker 4 posts since
Aug 31, 2006
Currently Being Moderated
8. Oct 18, 2006 5:00 PM in response to: Stonekeeper
Re: lost eth0 when using a copied ubuntu-server vm

Here is a script that should sort you out. I ran into

the same problem and this was my way of fixing it.

I'm sure it's not the best, but it works. Save it (I

called it "fixmac") and put into /usr/sbin/ on your

"base machine". Then, after shutting down and copying

your base machine, boot the new machine, log in, and

execute "fixmac" as root. Reboot and your interface

should start working.

 

---- Start Script ----

 

mac=`ifconfig -a | grep "HWaddr" | cut -d " " -f 11`

echo "eth0 mac $mac arp 1" > /etc/iftab

 

---- End Script ----

 

I hope that helps!

 

 

Quoted because this solution fixed a cold migration of an Ubuntu 6.06 (LAMP) server from ESX 2.52 --> ESX 3.0.1. Initially the server showed no known interfaces even after upgrading VMTools. After this script ran and the VM was rebooted eth0 was back up and running normally.

 

It did help, thank you!

pjgi4d Lurker 1 posts since
Oct 28, 2006
Currently Being Moderated
9. Oct 28, 2006 1:16 PM in response to: AndyTakacs
Re: lost eth0 when using a copied ubuntu-server vm

I had this same problem after I downloaded and tried to start this appliance:

http://www.young-technologies.com/Software/Subversion-Virtual-Machine/

 

ifconfig only reported lo

ifconfig -a reported a eth1 and lo, but no eth0

 

By changing the MAC in /etc/iftab to match the new one generated when I opened the appliance (Stored as ethernet0.generatedAddress in the .vmx file), it worked after reboot.

 

Thanks so much for a concise and accurate solution.

 

pjgi4d

RainerLfBS Lurker 2 posts since
Nov 28, 2006
Currently Being Moderated
10. Nov 28, 2006 8:30 AM in response to: adamsi
Re: lost eth0 when using a copied ubuntu-server vm

Hi,

 

your problems sound exactly like the problem we ran into when cloning a Debian installation.

 

The root of the problem at our site was udev's handling of devices. Udev keeps a history of devices attached to the computer. What makes sense for i.e. USB sticks (that is, each USB stick you attach will be recorded and mounted to the same point when attached again at a later point in time), causes problems when systems are cloned.

 

There is a file /etc/udev/rules.d/z25_persistent-net.rules, where udev memorises, which hardware device should get named eth0. Here it looks like this:

\# PCI device 14xx:16xx (tg3)

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", SYSFS\{address}=="00:11:xx:xx:xx:xx", NAME="eth0"

 

When you run the image on another computer, the new network adapter is recognised on the PCI bus and a new entry in the above mentioned file is generated. "eth0" is already given to device 14xx:16xx, so the new device gets named "eth1".

 

If you delete this file, it will be rebuilt during the next system startup and your problem should go away.

 

Regards,

Rainer

jjmateu Novice 17 posts since
Nov 20, 2006
Currently Being Moderated
11. Nov 28, 2006 10:13 AM in response to: adamsi
Re: lost eth0 when using a copied ubuntu-server vm

Hi:

 

Yoy need create a new mac address and the answer is here:

 

http://www.vmware.com/support/ws55/doc/ws_net_advanced_mac_address.html

 

After that, probably you must delete and create again the ethernet adapter in the guest and configure it using the hardware tool that provide by the Operating System.

roeschu Novice 25 posts since
Nov 16, 2006
Currently Being Moderated
12. Dec 22, 2006 2:44 AM in response to: jjmateu
Re: lost eth0 when using a copied ubuntu-server vm

just want to add that i had the same problem migrating a ubuntu guest from a vmware server to a esx server.

 

After migration the eth0 device was not present.

 

Solution was for me too, to see after the HW Adress in the new vmx file and write this HW Adress in /etc/iftab.

 

hope this helps other people too.

 

thx  a lot + greets

lilboy716 Lurker 1 posts since
Jan 1, 2007
Currently Being Moderated
13. Jan 1, 2007 9:42 PM in response to: roeschu
Re: lost eth0 when using a copied ubuntu-server vm

I have read through some of the previous posts and provided a step by step way to fix this.

 

I'm running Ubuntu, as guest & host

The Fix:

 

ifconfig -a

the "new" ethernet adapter may show up as eth1

 

write down the mac address: xx:xx:xx:xx:xx

 

cd /etc/

sudo vim iftab

 

change the existing mac address to your "new" ethernet adapter MAC address...

 

crossing my finger (I am writing this while I am making the changes)....

 

...

 

ping google.com

 

 

GREAT SUCCESS!

 

here are some other solutions to problem I've faced using VMWare Player

http://www.google.com/notebook/public/06509517885347462852/BDSrpIgoQ2vrxhvwh

 

Message was edited by:

        lilboy716

einjen Novice 26 posts since
Mar 30, 2007
Currently Being Moderated
14. Apr 3, 2007 6:49 AM in response to: RainerLfBS
Re: lost eth0 when using a copied ubuntu-server vm

Thank you!

 

this is infact the REAL solution...... for debian at least

Bookmarked By (0)

Share This Page

Communities