Page 1 of 1

How to use API to get harddisk size for my guest OS

PostPosted: 14. Oct 2008, 06:08
by liupengjian
Is there anyone knows how to use the API to get the hard disk size used by my guest OS?

e.g. My host is a window XP OS, I installed another WinXP in my VirtualBox and located 10GB for the gest, now I want to use Java webservice API to get the harddisk size which I allocated for the gests XP's disk size (ie. 10GB).

I read the API and find a method might be right for me, but there is little information in the documentation for me to know how can I call it.
In class the API has a method:
public IHardDisk getHardDisk(StorageBus bus, Integer channel, Integer device)
but I dont know how to pass in a StrogeBus object and where to get the Integer channel and the Integer device objects.

Very urgent, please help.

PostPosted: 14. Oct 2008, 10:47
by liupengjian
Ok, I got it , we should use IVirtualBox's method getHardDisks(), rather than by using IMachine's function to get the getHardDisk().