views:

340

answers:

3

what is the advantage of using a python virtualbox API instead of using XPCOM?

+1  A: 

From sun's site on VirtualBox python APIs:

SOAP allows to control remote VMs over HTTP, while XPCOM is much more high-performing and exposes certain functionality not available with SOAP.

They use very different technologies (SOAP is procedural, while XPCOM is OOP), but as it is ultimately API to the same functionality of the VirtualBox, we kept in bindings original semantics, so other that connection establishment, code could be written in such a way that people may not care what communication channel with VirtualBox instance is used.

From that article, I'm having trouble seeing the difference between "python virtualbox API" and "XPCOM". Could you provide a link to the API you're thinking of?

Jared Forsyth
pyvb (i.e python virtualbox )the documentation is in the link http://enomalism.com/api/pyvb
ask
+1  A: 

I would generally recommend against either one. If you need to use virtualization programmatically, take a look at libvirt, which gives you cross platform and cross hypervisor support; which lets you do kvm/xen/vz/vmware later on.

That said, the SOAP api is using two extra abstraction layers (the client and server side of the HTTP transaction), which is pretty clearly then just calling the XPCOM interface.

If you need local host only support, use XPCOM. The extra indirection of libvirt/SOAP doesn't help you. If you need to access virtualbox on a various hosts across multiple client machines, use SOAP or libvirt If you want cross platform support, or to run your code on Linux, use libvirt.

Enki
A: 

The advantage is that pyvb is lot easier to work with.

On the contrary the documentation for the python API of XPCOM doesn't exist, and the API is not pythonic at all. You can't do introspection to find methods/attributes of an object, etc. So you have to check the C++ source to find how it works or some python scripts already written (like vboxshell.py and VBoxWebSrv.py).

On the other hand pyvb is really just python wrapper that call VirtuaBoxManager on the command line. I don't know if it's a real disadvantage or not?

Etienne