On 19.04.2017 21:45, Azizul Hakim wrote:
Hi Klaus,

Thank you for your organized answer. Basically I am planning to write a VM introspection module for LibVMI. LibVMI does it for XEN. XEN by default has some exposed API to take advantage of VM introspection. I was looking into that source code of LibVMI and was exploring if something similar can be done for Virtual Box. As a start point, I started looking into VBoxVMM and some of the functions seemed to be analogous to the API's from XEN which made me believe I could use similar approach for VBox too.

There's introspection support in the VirtualBox API. No idea if it covers all your needs (or if you'll run into some essential API method which is specified but not implemented yet), but it's certainly worth a look. Using the API has the advantage that your code doesn't need to run in the VM context (which is getting very hard these days for security reasons). It also means that your choice of programming languages is much bigger than if your code would really need to be part of the VM process, since the API has many language bindings, e.g. from Python.

Some of the functionality can be invoked from the command line by "VBoxManage debugvm", and its source code could serve as a starting point.

The API description is available at https://www.virtualbox.org/sdkref/interface_i_machine_debugger.html

For pausing the VM you'll need to use other API methods (much more common ones, so you shouldn't have trouble finding sample code).

Having said that, I would like to know if there is any support from VBox for VM introspection and which part of the source code should I look into in case I've to add the support from scratch.

Don't think that you need to start from scratch...


Azizul Hakim


Message: 6
Date: Wed, 19 Apr 2017 19:52:06 +0200
From: Klaus Espenlaub <klaus.espenl...@oracle.com <mailto:klaus.espenl...@oracle.com>>
To: vbox-dev@virtualbox.org <mailto:vbox-dev@virtualbox.org>
Subject: Re: [vbox-dev] How to Initialize PUVM object from VM
Message-ID: <6a980edb-fc3d-c037-9467-4f056f425...@oracle.com <mailto:6a980edb-fc3d-c037-9467-4f056f425...@oracle.com>>
Content-Type: text/plain; charset=windows-1252; format=flowed

Hello Azizul,

On 19.04.2017 15:32, Azizul Hakim wrote:
> I'm doing some research on VirtualBox VMM. I'm trying to call some VMM
> functions from my library. Basically I was trying to call VMR3Suspend
> function and it takes an instance of PUVM. PUVM is only initialized
> during the creation of a VM. Which means I can't suspend a VM unless I
> created it. I was just wondering if there is some function which will
> initialize an instance of PUVM given its UUID/name.

There must be another way (it doesn't have to be calling the official
C++ API which offers a method to pause a VM, which internally calls
VMR3Suspend). Your code must be located in the VM process anyway, so it
should have some starting point (and no, there's no function call to
calculate PUVM from the VM UUID/name).

Who's calling your code? You should be able to get what you need...

> Because of the type of my work, I can not do it using other VBox tools.
> I've to do it through the VMM. Any guideline is much appreciated.

Too little information to help, I'm afraid.


> Best
> Azizul Hakim
vbox-dev mailing list

Reply via email to