Friday, August 31, 2012

Updating MAC Address After Cloning VirtualBox VM

If you want to clone a VM in VirtualBox, and want to have both VM's network-accessible, you have to select "Reinitialize the MAC address of all network cards" when creating the clone.  However, when starting your new clone, the network will try to use the old MAC address, so you'll have no connectivity.

[Note the below steps pertain to CentOS 6.2]

As root:
# vi /etc/udev/rules.d/70-persistent-net.rules
Get rid of the first line, which references eth0.  For the second line, change eth1 to eth0.  Make a note of the MAC address in this line (ATTR{address}). Save.

# vi /etc/sysconfig/network-scripts/ifcfg-Auto_eth0
Update HWADDR to be the new MAC address you made a note of in the previous step.  Save.

# service network restart

You should have connectivity now.

Taken from here http://zscribble.wordpress.com/2011/11/07/clone-a-virtual-machine-in-virtualbox/


No comments:

Post a Comment