[vbox-dev] trying to clone a vm
carlo.bongiovanni at gmail.com
Mon Jul 15 01:01:09 PDT 2013
I am running VirtualBox 4.2.10 on Ubuntu 12.04.
I am trying to clone a vm with the Java API. Doing this operation from the
console, I would issue the following command:
VBoxManage clonevm vmuid_src --name vmname_dest --register
With Java I am doing the following:
IMachine m_clone = vbox.findMachine(vmuid_src);
String m_clone_os = m_clone.getOSTypeId();
IMachine machine = vbox.createMachine(null, vmname_dest, null,
CloneMode cm = CloneMode.MachineState;
List<CloneOptions> cloneOptionsList = new ArrayList<CloneOptions>();
machine.cloneTo(m_clone, cm, cloneOptionsList);
After the execution of this code, I found a new vm in the list, but without
any storage attached. What am I missing? Can you direct me to the right way
to do it? I couldn't understand it from the sdkref.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vbox-dev