Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

There were some hard-coded file paths, etc., which caused 3. to fail.  However that step still failed even after I fixed them (all the ones I'm aware of, anyway).  At least it fails further along in the process  - the VM is created and a (virtual) disk is created for it, but the operation of attaching the disk to the VM fails. Since I don't expect to use the API to create VMs (only to activate them and run programs on them), there is no reason to pursue this. 

SDK cont'

...

March 15th update:The immediate goal is to write a C++ program using the sdk which will start up a pre-defined VM and get it to run some executable (and then perhaps shut it down). So far I've managed to get through the start-up step. This was much more painful than expected but, now that I've learned something about COM, xpcom, and where to look among VirtualBox source for interface information - there is formal and reasonably complete documentation for the API, but not really geared for use from C++ -  the last bit should be easier.

March 19th update: I was able to write a C++ program to accomplish the second step (run a program on the VM) but so far only after the VM was up and running.  If I try to do it all in one program the second step fails, I assume because the VM is in some sense not ready.    

June 11th update: Test program boots the VM, checks for "running state", checks for availability of disk and attempts to locate the particular script it intends to run.  Even when all these checks succeed, the running of the script can still fail.  However, it succeeds if a sleep of 100 seconds is inserted before attempting to run the script. 60 is not enough. This is not a very satisfactory state of affairs.

Other Interfaces

VirtualBox provides a variety of ways to get at the core functionality.  Approximately from least to most grungy:

...

VirtualBox shell  - extensible python interface. Have not yet tried it, but probably should.  It's only barely mentioned in the SDK document, but it looks like the some source is installed as a Python site package.  The main program is (relative to installation directory)

  sdk/bindings/glue/python/sample/vboxshell.py

On my machine that's /usr/lib/virtualbox/sdk/bindings/glue/python/sample/vboxshell.py  

See SDKRef.pdf, section 2.1.2, for a little more information.

Web service - exports nearly complete API.  Can be used via Java, Python, or as raw web service. I don't think it's appropriate for us.  We don't need the ability to control VMs remotely; I expect VM commands will be issued from the host.

...