I know of 2 ways to clone a VirtualBox machine on a linux host, one is by using the VirtualBox gui and exporting and re-importing as appliance (in the file menu of VirtualBox).
The other is by cloning only the virtual disk container files:
VBoxManage clonevdi /mnt/md1/original/root-fs.vdi /mnt/md1/cloned/root-fs.vdi
(Taken from http://forums.virtualbox.org/viewtopic.php?p=853#p858 )
Edit: this does not seem to work for VDI files that are already part of ~/VirtualBox/VirtualBox.xml, I get an error message:
ERROR: Cannot register the hard disk '/mnt/md1/original/root-fs.vdi' with UUID {96a1462b-c30a-4911-a954-d9093122f083} because a hard disk '/mnt/md1/original/root-fs.vdi' with UUID {96a1462b-c30a-4911-a954-d9093122f083} already exists in the media registry ('/home/mit/.VirtualBox/VirtualBox.xml')
I would have to create a new VM afterwards and use the cloned virtual disk containers.
Is it also possible to clone a VM by copying the virtual disk contianer files and the config files using filesystem commands and do the rest by hand?
I'd have to manually edit the ~/VirtualBox/VirtualBox.xml and insert a new disk and a new machine:
Can I just make up UUIDs or how would this work?
I would very much prefer this hardcore method of doing things as it allows me to freely and rapdily backup, restore, move or clone machines. Or ist there a better way to do this?