Проблема в том, что объект, возвращаемый FindMachine("kubuntu")
, не поддерживает IDispatch interface
, а win32com не поддерживает это.
Для этого вы можете использовать мой comtypes
пакет http://starship.python.net/crew/theller/comtypes/, но вам нужно исправить версию в репозитории, чтобы она работала с библиотеками типов VirtualBox.
Вот демонстрационная сессия:
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from comtypes.client import CreateObject
>>> box = CreateObject("VirtualBox.VirtualBox")
>>> m = box.FindMachine("Fedora")
>>> print m.State
4
>>> print m.CpuCount
1
>>> print m.Name
Fedora
>>>
А вот патч, который вам нужен:
Index: automation.py
===================================================================
--- automation.py (revision 507)
+++ automation.py (working copy)
@@ -753,6 +753,8 @@
c_float: VT_R4,
c_double: VT_R8,
+ c_ulonglong: VT_I8,
+
VARIANT_BOOL: VT_BOOL,
BSTR: VT_BSTR,