<div dir="ltr"><div>Hi All, <br><br></div><div>I am running VirtualBox 4.2.10 on Ubuntu 12.04.<br></div><div><br>I am trying to clone a vm with the Java API. Doing this operation from the console, I would issue the following command:<br>
VBoxManage clonevm vmuid_src --name vmname_dest --register<br><br></div>With Java I am doing the following:<br><div><div><br> IMachine m_clone = vbox.findMachine(vmuid_src);<br> String m_clone_os = m_clone.getOSTypeId();<br>
IMachine machine = vbox.createMachine(null, vmname_dest, null, m_clone_os, null);<br> machine.saveSettings();<br> vbox.registerMachine(machine);<br><br> CloneMode cm = CloneMode.MachineState;<br>
List<CloneOptions> cloneOptionsList = new ArrayList<CloneOptions>();<br> cloneOptionsList.add(CloneOptions.KeepAllMACs);<br><br> machine.cloneTo(m_clone, cm, cloneOptionsList);<br clear="all">
<div><br></div><div>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. <br>
<br></div><div>Thanks, best<br>Carlo<br></div></div></div></div>