JAVA tool and problems..

This is for discussing general topics about how to use VirtualBox.
Post Reply
ThisUsernameIsTaken
Posts: 2
Joined: 9. Oct 2009, 11:14
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu

JAVA tool and problems..

Post by ThisUsernameIsTaken »

Hiya Guys!

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);
Can anyone give me the solution, or tell me what I am doing wrong?

Greetings Me!
Post Reply