Opened 9 years ago
Closed 9 years ago
#15035 closed defect (invalid)
SDK python lib webbindings createMachine() doesn't take groups into account
Reported by: | Alberto Geniola | Owned by: | |
---|---|---|---|
Component: | webservices | Version: | VirtualBox 5.0.12 |
Keywords: | sdk CreateMachine vboxwebsrv | Cc: | |
Guest type: | other | Host type: | Windows |
Description
Hi everyone, I am using VirtualBox 5.0.12 on Windows x64 with official SDK. I've experienced a problem when using IVirtualBox::CreateMachine() with webservice bindngs.
Problem: machine gets created but machine is not added to the specified group.
To reproduce:
... m = vbox.createMachine(_arg_settingsFile='', _arg_name=name, _arg_groups=['/test'], _arg_osTypeId=ostype, _arg_flags='forceOverwrite=0') vbox.registerMachine(m) ...
I have also tried using IVirtualBox::composeMachineFilename() to get the filename, but nothing changes:
... filename = vbox.composeMachineFilename(_arg_name='a_machine', _arg_group='/test', _arg_createFlags='', _arg_baseFolder='c:\VMs') m = vbox.createMachine(_arg_settingsFile=filename, _arg_name=name, _arg_groups=['/test'], _arg_osTypeId=ostype, _arg_flags='forceOverwrite=0') vbox.registerMachine(m) ...
As I said before, machine gets created but output from VBoxManage showvm says there's no associated group for the created vm.
Change History (2)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Something doesn't add up. Looks to me like you are somehow using an outdated SDK install in python (which corresponds to the API version 4.1!), trying to make it talk to the current API. What you describe is a manual way to correct this by overwriting some outdated files. Neither the SDK nor the VirtualBox base package itself can possibly contain the outdated files, they must be from somewhere else.
I found the problem.
The SDK bundle available as download from Virtualbox website contains correct definitions of wsdl but python libs have not been update.
To fix it, just execute the following code from cmd:
then copy the two generated python files (VirtualBox_services.py and VirtualBox_services_types.py) into the libs folder of your python installation (mine is C:\Python27\Lib\site-packages\vboxapi).
This fixes this problem on windows.
I encourage Oracle to update the SDK bundle to fix this annoying problem.