VirtualBox Clone Root HD / Ubuntu / Network issue

When you clone a root Ubuntu disk in VirtualBox, one thing that gets messed up is the network card definition.  This is because Ubuntu (as it should) uses UDEV IDs for the network device.  When you boot your new disk, the network device ID has changed, so it creates a new eth1 device.  Unfortunately, this conflicts with the VirtualBox network setup.  What to do?

Boot the box (no network)

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

Delete the eth0 line and modify the eth1 line to be eth0

--------- Example OLD -----------

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)    <-------------------- Delete these two lines
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:d8:8d:15", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100e (e1000)     ---Modify the next line and change eth1 to be eth0
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:89:84:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

----------------------------------------

--------- Example NEW -----------

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:89:84:98", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

----------------------------------------

Comments:

I thought that have wrong clone and repeat a few times.
Till i realize there some problem on VBOX clone network.

Search on Google and found your blog.

Thanks dude! You save my life!

Posted by yoodey on October 24, 2011 at 09:58 PM EST #

Thanks. Very helpful.

Posted by guest on March 22, 2012 at 12:20 PM EST #

dude thanks for this. spent about 45 mins troubleshotting this.
thus deserves two minutes for kudos!!

Posted by kongo on June 13, 2012 at 03:41 AM EST #

You legend. Thank you!

Posted by guest on July 24, 2012 at 08:34 PM EST #

Just wanted to say thanks, this bit me on a Gentoo clone and this reminded me to purge the udev rules.

Posted by Sarah on August 29, 2012 at 10:50 PM EST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

me

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today