I've run into a curious error while cloning Ubuntu VM hard drives. After cloning, the network card no longer works. However, if I clone the VM completely (including the mac address), there is no problem. The reason for this is that Ubuntu, upon installation, stores the mac address of the network card. This ensures the same network card will always be mapped to eth0, and future network cards will be eth1, etc.

However, this behavior is not desirable when cloning a VM.

One solution is to delete the stored mac address upon booting, which can be done with this script (add it to /etc/rc.local ):

This will fail horribly if your VM has multiple network interfaces.

Subscribe to the mailing list