def vb_clone_vm(name=None, clone_from=None, timeout=10000, **kwargs):
 vbox = vb_get_box()
 log.info('Clone virtualbox machine %s from %s', name, clone_from)
 source_machine = vbox.findMachine(clone_from)
 groups = None
 os_type_id = 'Other'
 new_machine = vbox.createMachine(None, name, groups, os_type_id, None)
 progress = source_machine.cloneTo(new_machine, 0, None)
 progress.waitForCompletion(timeout)
 log.info('Finished cloning %s from %s', name, clone_from)
 vbox.registerMachine(new_machine)
 return vb_xpcom_to_attribute_dict(new_machine, 'IMachine')

def vb_clone_vm ( name = None , clone_from = None , timeout = 10000 , ** kwargs ) : vbox = vb_get_box ( ) log . info ( 'Clone virtualbox machine %s from %s' , name , clone_from ) source_machine = vbox . findMachine ( clone_from ) groups = None os_type_id = 'Other' new_machine = vbox . createMachine ( None , name , groups , os_type_id , None ) progress = source_machine . cloneTo ( new_machine , 0 , None ) progress . waitForCompletion ( timeout ) log . info ( 'Finished cloning %s from %s' , name , clone_from ) vbox . registerMachine ( new_machine ) return vb_xpcom_to_attribute_dict ( new_machine , 'IMachine' )
tells virtualbox to create a vm by cloning from an existing one .