<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    On 19.04.2017 21:45, Azizul Hakim wrote:<br>
    <blockquote
cite="mid:CAOyD9QGdGFeA--WsFa+z56Vf0pO__7FRFucH9HQP+BVy=tKzbw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Klaus,
        <div><br>
        </div>
        <div>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.</div>
      </div>
    </blockquote>
    <br>
    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.<br>
    <br>
    Some of the functionality can be invoked from the command line by
    "VBoxManage debugvm", and its source code could serve as a starting
    point.<br>
    <br>
    The API description is available at
    <a class="moz-txt-link-freetext" href="https://www.virtualbox.org/sdkref/interface_i_machine_debugger.html">https://www.virtualbox.org/sdkref/interface_i_machine_debugger.html</a><br>
    <br>
    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).<br>
    <br>
    <blockquote
cite="mid:CAOyD9QGdGFeA--WsFa+z56Vf0pO__7FRFucH9HQP+BVy=tKzbw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>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.</div>
      </div>
    </blockquote>
    <br>
    Don't think that you need to start from scratch...<br>
    <br>
    Klaus<br>
    <blockquote
cite="mid:CAOyD9QGdGFeA--WsFa+z56Vf0pO__7FRFucH9HQP+BVy=tKzbw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks</div>
        <div class="moz-signature">Azizul Hakim<br>
          <br>
          ------------------------------<br>
          <br>
          Message: 6<br>
          Date: Wed, 19 Apr 2017 19:52:06 +0200<br>
          From: Klaus Espenlaub <<a moz-do-not-send="true"
            href="mailto:klaus.espenlaub@oracle.com">klaus.espenlaub@oracle.com</a>><br>
          To: <a moz-do-not-send="true"
            href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br>
          Subject: Re: [vbox-dev] How to Initialize PUVM object from VM<br>
                  UUID/name<br>
          Message-ID: <<a moz-do-not-send="true"
            href="mailto:6a980edb-fc3d-c037-9467-4f056f425cf3@oracle.com">6a980edb-fc3d-c037-9467-<wbr>4f056f425cf3@oracle.com</a>><br>
          Content-Type: text/plain; charset=windows-1252; format=flowed<br>
          <br>
          Hello Azizul,<br>
          <br>
          On 19.04.2017 15:32, Azizul Hakim wrote:<br>
          > I'm doing some research on VirtualBox VMM. I'm trying to
          call some VMM<br>
          > functions from my library. Basically I was trying to call
          VMR3Suspend<br>
          > function and it takes an instance of PUVM. PUVM is only
          initialized<br>
          > during the creation of a VM. Which means I can't suspend
          a VM unless I<br>
          > created it. I was just wondering if there is some
          function which will<br>
          > initialize an instance of PUVM given its UUID/name.<br>
          <br>
          There must be another way (it doesn't have to be calling the
          official<br>
          C++ API which offers a method to pause a VM, which internally
          calls<br>
          VMR3Suspend). Your code must be located in the VM process
          anyway, so it<br>
          should have some starting point (and no, there's no function
          call to<br>
          calculate PUVM from the VM UUID/name).<br>
          <br>
          Who's calling your code? You should be able to get what you
          need...<br>
          <br>
          > Because of the type of my work, I can not do it using
          other VBox tools.<br>
          > I've to do it through the VMM. Any guideline is much
          appreciated.<br>
          <br>
          Too little information to help, I'm afraid.<br>
          <br>
          Klaus<br>
          <br>
          > Best<br>
          > Azizul Hakim<!-- This signature was generated by the MyDesktop Oracle Business Signature utility version 5.0 -->
        </div>
      </div>
    </blockquote>
  </body>
</html>