Debian eth0, eth1, eth2, in Virtualbox or VMware Virtual machines when copying

Debian uses udev. Udev handles mapping MAC’s to the appropriate /dev/eth(X) file. If you copy a Virtual machine, Udev will remember the MAC address of the old NIC. When you copy the machine, the virtual host usually generates a new MAC address for the VM.
Udev will assign the new Device to eth1, eth2, and so on. If you want to change your NIC assignments make Udev forget the old MAC.
In Debian 5 (lenny) it is in this file:

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

In Debian 4 (etch) it is in this file:

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

To apply changes in Lenny: “udevadm trigger” or “udevtrigger” (in Etch)

Related posts:

  1. Vmware – Unable to change virtual machine power state: Internal error.
  2. Install the proprietary Closed source version of Virtualbox on Debian Lenny
  3. Install backupexec 12.5 agent on Debian Lenny

  1. Pretty useful info. Was confused as to why the machine kept creating new eth devices and so messing up my static configuration for one of the devices.

    Cheers for the explanation.

    • eric m
    • June 2nd, 2010

    maybe add a line to your .bashrc pointing to a script that clears the persistent rules file on startup

    just an idea..

  1. No trackbacks yet.

 

Switch to our mobile site