Closed nilp0inter closed 10 years ago
Thanks for your post.
Problem: This issue looks like it comes from the library pyvbox (COM / XPCOM) interface to VirtualBox. When an attempt to retrieve IGuestSession's getStatus value, pyvbox is returning None (NULL) instead of returning a valid status code.
As a reference, valid GuestSessionStatus status code values are defined here: http://pythonhosted.org//pyvbox/virtualbox/library.html#virtualbox.library.GuestSessionStatus ...
I believe issue #7 suffered from the same problem you're experiencing in this issue. I also documented a few details about this problem in this response: http://stackoverflow.com/a/21820905/2660243.
Ways forward:
A) Try upgrading to the latest VirtualBox (currently 4.3.10) https://www.virtualbox.org/wiki/Downloads
If that fails:
B) Hack https://github.com/mjdorma/pyvbox/blob/master/virtualbox/library_ext/guest.py to capture this error and keep on trying (in the wait for guess sessoin).
In the meantime:
C) Look into raising a special exception when the vboxapi returns None. This way it should be a bit easier to add hack code like in B) to handle the error and try again. In the very least, it will give a more sane error.
I think I'll work on a solution for C) in the next few days. Once you've upgraded to the latest VirtualBox, and if the error still persists, I'd like to know if B) solves your problem.
It would be great if you could have a go at A & B and let me know if it works out? If it doesn't workout, then it means we have a different error (quite possibly something to do with Debian and VirtuaBox).
Cheers
A) Fixes the problem. (Version: 4.3.10-93012~Debian~wheezy) B) raises "SystemError: GuestSession failed to start" due to a timeout. https://github.com/nilp0inter/pyvbox/commit/f8b1c08775219d240e2a6b6a9ac9d7efa4640332
In [10]: gs=session.console.guest.create_session('test', 'test')
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
<ipython-input-10-1246d0c194e1> in <module>()
----> 1 gs=session.console.guest.create_session('test', 'test')
/home/vagrant/local/lib/python2.7/site-packages/pyvbox-0.1.4-py2.7.egg/virtualbox/library_ext/guest.pyc in create_session(self, user, password, domain, session_name, timeout_ms)
26 time.sleep(0.1)
27 else:
---> 28 raise SystemError("GuestSession failed to start")
29 if timeout_ms != 0:
30 # There is probably a better way to to this?
SystemError: GuestSession failed to start
Regards
5d9b891 should make the Enum types clearer as they are never enumerated with a default of None. The attribute handing code was also in a funny state. I think at one point I was raising an error if vboxapi returned None from an attribute getter (but that is a dangerous and probably incorrect generalisation).
If you're trying to get the guest session going and you think there is a bug to be fixed there, please start a new issue so we can discuss.
Thanks for your input!
Cheers
I can still reproduce this issue with virtualbox 4.3.14 (r95030) I am running OSX 10.9.3 Python 2.7.5
The following code produces ValueError: Can not find enumeration where value=None
vbox = virtualbox.VirtualBox()
vm = vbox.find_machine('10.8')
session = vm.create_session()
gs = session.console.guest.create_session('beta', 'beta')
The traceback is as follows:
Traceback (most recent call last):
File "installer_automation.py", line 41, in <module>
gs = session.console.guest.create_session('beta', 'beta')
File "/Users/davidterry/.virtualenvs/installer_automation/lib/python2.7/site-packages/virtualbox/library_ext/guest.py", line 20, in create_session
if session.status == library.GuestSessionStatus.started:
File "/Users/davidterry/.virtualenvs/installer_automation/lib/python2.7/site-packages/virtualbox/library.py", line 15317, in status
return GuestSessionStatus(ret)
File "/Users/davidterry/.virtualenvs/installer_automation/lib/python2.7/site- packages/virtualbox/library_base.py", line 63, in __init__
raise ValueError("Can not find enumeration where value=%s" % value)
ValueError: Can not find enumeration where value=None
Also experiencing on VirtualBox 4.3.18. I am running Ubuntu 14.04.01 LTS x64 python 2.7,6 installed pyvbox today from pip install pyvbox
$python import virtualbox vbox = virtualbox.VirtualBox() m = vbox.machines[0] s = m.create_session() s.console.guest.create_session('beta', 'beta')
Traceback (most recent call last):
File "
Hi,
I'm trying to start a guest session but it seems that something it's not initialized properly.
My setup:
The traceback:
Thank you for this great package.