Cloning linux servers easily in VirtualBox without network cards

I thought I’d share a little trick with you that I’ve recently used to enable easier cloning of virtual machines in Virtualbox (for my local development enviroment on my MacBook Pro)…

Those who have attempted to ‘clone’ virtual machines in the past may have found that when attempting to clone Linux Server VM’s (specially in my case, Ubuntu 12.04LTS) that the network interface cards do not work (eth0 is not detected)

Well, this is what I’ve done and how to fix it….

If you just want to fix the problem on a single cloned Virtual machine, simply log into your cloned VM as root (or use sudo accordingly) and run the following command:-

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

The next time you restart your virtual machine your virtual network card will now be working again, hurrah!!

So now I did say that I’d show you a little trick… and as I find it VERY useful to clone Linux Servers for testing, what I’ve done is installed Ubuntu 12.04 LTS server edition as a standard VM,  updated it with all the latest updates (using apt-get update && apt-get upgrade) then I’ve updated the /etc/motd.tail file with some helpful test (screenshot below), updated the /etc/network/interface file with my local LAN subnet, gateway and DNS server information and a place holder to put the new IP once the server has been cloned and finally deleted the above 70-persistent-net.rules file….

The result is a standard VM which you can then use as a template to create new VM’s from using the ‘Clone’ feature.