How to use create_unattended_installer()
ENVIRONMENT
- Operating System: Windows 10 - 1903
- Python version: 3.7
- VirtualBox version: 6.0.10
- VirtualBox SDK version: 6.0.10
- Location where VirtualBox SDK is installed:
- virtualbox-python / pyvbox version: latest
- [x] Happens in latest
masterbranch?
SUMMARY
Hello, I am currently using your library to create a virtual machine automatically, until then everything works. I want to use the automatic ISO installation, but that does not work, can you explain to me how this is supposed to work?
Here is the code snippet that I tried:
__iso_file = os.getcwd() + "/data/isos/" + cfg['machine']['iso']
__installer = self.vbox.create_unattended_installer()
__installer.iso_path = __iso_file
__installer.machine = IMachine(machine)
__installer.prepare()
__installer.construct_media()
__installer.reconfigure_vm()
And here is what it returns to me:
TypeError: Objects of type 'IMachine' can not be converted to a COM VARIANT (but obtaining the buffer() of this object could)
If someone can help me, thank you!
Have you tried substituting IMachine(machine) for self.vbox.find_machine(machine)?
Hello, thank you for your answer.
The variable "machine" here is the return of the creation of my machine that I do just before:
machine = self.vbox.create_machine
I tried directly with a find_machine but the return is the same as in my previous question. Nevertheless I checked the variable "machine" is well considered as an object "IMachine", otherwise I will have like return "value is not an instance of IMachine".
I have the impression that the problem is located further, here are more logs:
Traceback (most recent call last):
File "C:/Users/Node/Desktop/git/auto-manage-machine/automanagemachine/run.py", line 30, in <module>
machine.run_install(vm)
File "C:\Users\Node\Desktop\git\auto-manage-machine\automanagemachine\components\machine\machine_vbox.py", line 59, in run_install
__installer.machine = IMachine(machine)
File "C:\Users\Node\Desktop\git\auto-manage-machine\venv\lib\site-packages\virtualbox\library.py", line 9710, in machine
return self._set_attr("machine", value)
File "C:\Users\Node\Desktop\git\auto-manage-machine\venv\lib\site-packages\virtualbox\library_base.py", line 184, in _set_attr
return setattr(self._i, name, value)
File "C:\Users\Node\Desktop\git\auto-manage-machine\automanagemachine\vboxapi\__init__.py", line 193, in _CustomSetAttr
return _g_dCOMForward['setattr'](self, ComifyName(sAttr), oValue)
File "C:\Users\Node\Desktop\git\auto-manage-machine\venv\lib\site-packages\win32com\client\__init__.py", line 482, in __setattr__
self._oleobj_.Invoke(*(args + (value,) + defArgs))
TypeError: Objects of type 'IMachine' can not be converted to a COM VARIANT (but obtaining the buffer() of this object could)
Hello, I raise, did you already use this function? Is this a bad use or is this function not implemented? On my side I still have not managed to use it after several tests...
thank you