I'm creating a java tool to manage Virtualbox trough vboxwebsrv.
At this point it works perfect I have to say! But a problem im stuck on is creating new harddrives. I've got some base images which I want to clone to a newly (with the tool) created harddrives. It keeps giving me errors and I can't understand why?!
This is my code:
Code: Select all
IProgress cloneProgress;
IHardDisk newHDD = vbox.createHardDisk("vdi", "/home/olivier/Documents/xp2.vdi");
IHardDisk existingHDD;
IStorageController storageControl = null;
existingHDD = vbox.findHardDisk("/home/olivier/Documents/XP.vmdk");
BigInteger size = new BigInteger("10000");
newHDD.createBaseStorage(size, org.virtualbox_3_0.HardDiskVariant.FIXED);
newHDD.createDiffStorage(newHDD, org.virtualbox_3_0.HardDiskVariant.DIFF);
cloneProgress = existingHDD.cloneTo(newHDD, org.virtualbox_3_0.HardDiskVariant.DIFF, null);
cloneProgress.waitForCompletion(100000);
Greetings Me!