Home > pyvix

pyvix

Pyvix is a project mainly written in C and PYTHON, it's free.

python bindings for vmware vix api

pyvix is a Python wrapper for the VMWare VIX C API that allows Python to programmatically control VMWare virtual machines.

Example operations include:

  • powering on/off;
  • suspending;
  • creating, reverting to, and removing snapshots;
  • sending/receiving files to/from the virtual machine;
  • running programs on the virtual machine.

= Build and install = rm -rdf build/; python setup.py build; python setup.py install

Note that python setup.py build will call gcc to build the Python extension module and link it to libvmware-vix.so. Make sure you use the same compiler version for both libvmware-vix.so and the extension. I "solved" some Segmentation Faults by matching the compiler versions.

= Run tests = a) /usr/bin/py.test

  • this will run all tests in tests/
  • add "-v" to see the actual tests
  • add "-s" to see printf() from the C extensions and print from Python

b) gdb --args /usr/bin/python /usr/bin/py.test tests/test_vm.py -s -v

  • run it like this under gdb: it needs as first argument a binary executable, not a script.
Previous:Euler