sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

IGuest.create_session() fails with an empty password #62

Closed sethmlarson closed 7 years ago

sethmlarson commented 7 years ago
ENVIRONMENT
SUMMARY

When creating an IGuestSession via IGuest.create_session() if a zero-length password is given an error will be raised. This was found originally by @aGGeRReS in issue #47. Proposed fix is to throw a better error message if this error is caught and an empty password is used.

STEPS TO REPRODUCE
vbox = virtualbox.VirtualBox()
session = virtualbox.Session()
vm = vbox.find_machine('Windows7')
vm.launch_vm_process(session, 'gui', '').wait_for_completion()

session = vm.create_session()
gs = session.console.guest.create_session('win7', '')
EXPECTED RESULTS

To login to the Guest Session with an empty password.

ACTUAL RESULTS

Raises an exception

gs = session.console.guest.create_session('win7', '')
File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_ext/guest.py", line 24, in create_session
raise SystemError("GuestSession failed to start")
SystemError: GuestSession failed to start