1 2 Previous Next 28 Replies Latest reply on Mar 4, 2013 2:47 PM by cosy

    lost eth0 when using a copied ubuntu-server vm

    adamsi Lurker

      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

        • 1. Re: lost eth0 when using a copied ubuntu-server vm
          kingneutron Master

          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.

          • 2. Re: lost eth0 when using a copied ubuntu-server vm
            adamsi Lurker

            Thank you for your reply

             

            vmplayer didn't ask the "location changed" question. I've expected it to ask but nothing happened, the vm just started up.

            • 3. Re: lost eth0 when using a copied ubuntu-server vm
              nick.couchman Champion

              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.

              • 4. Re: lost eth0 when using a copied ubuntu-server vm
                nome Lurker

                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

                • 5. Re: lost eth0 when using a copied ubuntu-server vm
                  nick.couchman Champion

                  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.

                  • 6. Re: lost eth0 when using a copied ubuntu-server vm
                    Stonekeeper Lurker

                    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!

                    • 7. Re: lost eth0 when using a copied ubuntu-server vm
                      Eric_B Lurker

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

                      • 8. Re: lost eth0 when using a copied ubuntu-server vm
                        AndyTakacs Lurker

                        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!

                        • 9. Re: lost eth0 when using a copied ubuntu-server vm
                          pjgi4d Lurker

                          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

                          • 10. Re: lost eth0 when using a copied ubuntu-server vm
                            RainerLfBS Lurker

                            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

                            • 11. Re: lost eth0 when using a copied ubuntu-server vm
                              jjmateu Novice

                              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.

                              • 12. Re: lost eth0 when using a copied ubuntu-server vm
                                roeschu Novice

                                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

                                • 13. Re: lost eth0 when using a copied ubuntu-server vm
                                  lilboy716 Lurker

                                  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

                                  • 14. Re: lost eth0 when using a copied ubuntu-server vm
                                    einjen Novice

                                    Thank you!

                                     

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

                                    1 2 Previous Next