Wednesday, December 15, 2010

How to solve eth0 missing in VirtualBox

Suppose you setup a linux virtual machine in VirtualBox and once you clone that hard disk and attach to a new virtual machine you notice that eth0 is not available. The problem is related to fact that since the MAC address of network adapter has changed (you created a new virtual machine) kernel has reconfigured it to be used by next available name, e.g. eth1. So what you need is simply open file /etc/udev/rules.d/70-persistent-net.rules in your favorite editor and remove a line that uses currently eth0 and change the line with NAME="eth1" to NAME="eth0". Here is an example:
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", \
ATTR{address}=="08:00:27:43:0b:0f", ATTR{dev_id}=="0x0", \
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
Probably simplest way to do this:
echo > /etc/udev/rules.d/70-persistent-net.rules
reboot

9 comments :

  1. Simple, awesome man.Big thx for your post.Cheers.

    ReplyDelete
  2. ty really helpfull

    ReplyDelete
  3. Well explained. Thanks!

    ReplyDelete
  4. Thanks alot.
    Even me also can able to see the eth0.
    But ip address 10.0.2.15 not showing.
    if type the command ifconfig or ifconfig eth0.
    Can you help me

    ReplyDelete