[vbox-dev] Hard Drive Statistics

Klaus Espenlaub espenlaub at innotek.de
Wed Feb 13 03:00:20 PST 2008

Nate DeSimone wrote:
> Hello Everyone,
> 	I'm fairly new to Virtual Box so please bear with me.  I am currently 
> doing research that requires me to monitor hard disk access for various 
> software environments.  I noticed that Virtual Box already has a 
> statistics engine built in, and that statistics are outputted to the end 
> of the log file.  Is there any way to get more detailed information, 
> like if the access was a read or a write, and when the access occurred?

You mean keeping a timestamp, block size and data direction for each and 
every read or write? That'll be extremely costly, as that data 
accumulates very quickly. You'll have to add that sort of 
instrumentation yourself - but hey, you already have the source code.

> 	What I would like to do is monitor the size of hard disk access bursts, 
> separately for both reads and writes.

Note that the transfer chunks for disks are usually limited to 64K by 
the disk buffer size. So you won't ever see bigger transfers as the 
guest will limit its transfers to that size.

> 	Is there functionality in Virtual Box for this more advanced data 
> gathering, and if not how would I go about adding it?  I have already 
> downloaded Virtual Box's source code and built myself binaries.

You can add such instrumentation either directly to DevATA.cpp or to 
e.g. DrvBlock.cpp. If you need feedback while the VM is running there's 
also a logging framework you can use. But of course be aware that such 
instrumentation is never for free. It will slow down VM execution and by 
that changes the access characteristics of the guest OS more or less 

Dr. Klaus Espenlaub     innotek GmbH, http://www.innotek.de

More information about the vbox-dev mailing list