Highlighted
Contributor
Contributor

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

0 Kudos
28 Replies
Highlighted
Contributor
Contributor

I ran into this problem on Debian Etch. If the vm only has one interface you can disable udev's interface cache by renaming the following rules:

/etc/udev/rules.d/z25_persistent-net.rules --> /etc/udev/rules.d/z25_persistent-net.rules.disabled

/etc/udev/rules.d/z45_persistent-net-generator.rules --> /etc/udev/rules.d/z45_persistent-net-generator.rules.disabled

The upside of this solution is that, as long as the vm only has one interface, it will always be named eth0, even if the mac address changes.

The downside is that you will probably have to use manually configured mac addresses if you want any reliability with multiple interfaces. But this is true in the case of the other suggested remedies also.

0 Kudos
Highlighted
Contributor
Contributor

For Ubuntu 8.04 I got eth0 work by doing the following:

sudo rm /etc/udev/rules.d/70-persistent-net.rules
sudo reboot

Also I went back and removed the 70-persistent-net.rules from my gold source used for cloning.

0 Kudos
Highlighted
Contributor
Contributor

hi Lance;

Your solution also applies to ubuntu 8.10 server edition .

thank you.

http://harunsahiner.blogspot.com
0 Kudos
Highlighted
Contributor
Contributor

Thanks lilboy716, 2 years later and this still seems to be a problem when copying a VMWare.

This is what I had to do on Ubuntu:

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

Thanks!

0 Kudos
Highlighted
Contributor
Contributor

Same problem after a conversion of an Ubuntu server.

Your script DID fix it! Thanks!

0 Kudos
Highlighted
Contributor
Contributor

Clarification about the solution for ubuntu...as of version 8.04 (I think that's when the switch happened), /etc/iftab was replaced with /etc/udev/rules.d/70-persistent-net.rules. At least looking at my 10.04 version, it's this. So your fix will depend based on the ubuntu version you're running.

0 Kudos
Highlighted
Contributor
Contributor

(I had this problem with VMware Workstation 7.1.3 and as I had a support contract I called it in.  What follows is their working solution for a VM running Ubuntu Server 10.04 LTS on VMware Workstation - RCHF)

The solution involves running commands in the command prompt in the Ubuntu Server virtual machine.

Use your preferred text editor to open /etc/udev/rules.d/70-persistent-net.rules as root You may want to backup /etc/udev/rules.d/70-persistent-net.rules by using cp just in case.

Two PCI devices should be listed.
The one listed as using pcnet32 will be named eth0 and will have the MAC address of the original virtual machine's network adapter.

The second PCI device is listed as using vmxnet and will be named eth1 and will have the MAC address of the new network adapter.

Replace the ATTR{address}=="" entry for eth0 with the ATTR{address}=="" entry for eth1 Once that's done delete the entire entry for the PCI device named eth1.
Save the file and reboot.

Once the system is rebooted the issue will be resolved

0 Kudos
Highlighted
Contributor
Contributor

Method 1:

- Uncomment the following line in /etc/udev/rules.d/70-persistent-net.rules

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="YOUR_MAC", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

reboot machine or restart networking

Method 2:

- change eth0 to eth1 in /etc/network/interfaces

reboot machine or restart networking

edit: if you use method nr 2, you'll get a new line in /etc/udev/rules.d/70-persistent-net.rules when you reboot

0 Kudos
Highlighted
Contributor
Contributor

HI Guys,

After clone the VM got the DHCP assign IP. So i had look and found eth0 is missing. then i follow this

So here’s how we fix it:

  1. Remove the kernel’s networking interface rules file so that it can be regenerated

    # rm -f /etc/udev/rules.d/70-persistant-net.rules

  2. Restart the VM

    # reboot

  3. UPDATE your interface configuration file

    # vim /etc/sysconfig/networking/devices/ifcfg-eth0

    Remove the MACADDR entry or update it to the new MACADDR for the interface (listed in this file: /etc/udev/rules.d/70-persistent-net.rules).

    Remove the UUID entry

    Save and exit the file

  4. Restart the networking service

    # service network restart
    But this VM is authenticate to Active Directory and now its not working?
0 Kudos