virtualbox-python icon indicating copy to clipboard operation
virtualbox-python copied to clipboard

Issue with Callee RC: NS_ERROR_CALL_FAILED (0x800706BE)

Open gmatano opened this issue 7 years ago • 6 comments

ENVIRONMENT
  • Operating System: Ubuntu 16.04

  • Python version: 2.7

  • VirtualBox version: 5.2.18

  • VirtualBox SDK version:

  • Location where VirtualBox SDK is installed: VBOX_INSTALL_PATH=/usr/bin/virtualbox VBOX_SDK_PATH=/usr/lib/virtualbox/sdk

  • pyvbox version: Version: 1.3.2

  • [ ] Happens in latest master branch? Yes

SUMMARY

I've been trying to launch virtualbox with the script on pyxbox's site below:

import virtualbox

vbox = virtualbox.VirtualBox() print("VM(s):\n + %s" % "\n + ".join([vm.name for vm in vbox.machines])) session = virtualbox.Session() vm = vbox.find_machine('U') progress = vm.launch_vm_process(session, 'gui', '')

Every time I do that I get "Callee RC: NS_ERROR_CALL_FAILED (0x800706BE)" in the virtualbox menu. The interesting thing is that I can launch the vm fine within the virtualbox manager menu but not with the pyvbox launch script. My virtualbox software is currently running the most recent update as well. Any assistance on this will be greatly appreciated.

gmatano avatar Sep 14 '18 00:09 gmatano

You may want to try creating a Session and locking the machine, then using the session.machine.launch_vm_process()?

sethmlarson avatar Sep 14 '18 13:09 sethmlarson

I'm not sure what you mean by this. Do you mean launching the virtualbox within the virtual box manager and then run the python script to with session.machine.launch_vm_process()?

On Fri, Sep 14, 2018 at 6:46 AM Seth M. Larson [email protected] wrote:

You may want to try creating a Session and locking the machine, then using the session.machine.launch_vm_process()?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SethMichaelLarson/virtualbox-python/issues/117#issuecomment-421363554, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGFddeg0WVCn9EilDhat04olaEE9uRSks5ua7NGgaJpZM4WoaZ3 .

gmatano avatar Sep 14 '18 17:09 gmatano

I'll play around with this when I get time and give you a better answer. Typically when you have a machine that you want to lock you use the session.machine object rather than the original machine instance you used to lock with the session. It's confusing I know.

sethmlarson avatar Sep 14 '18 17:09 sethmlarson

Ran this:

import virtualbox

vbox = virtualbox.VirtualBox() print("VM(s):\n + %s" % "\n + ".join([vm.name for vm in vbox.machines])) session = virtualbox.Session() vm = vbox.find_machine('U') progress = session.machine.launch_vm_process()

Got this traceback: VM(s):

  • U Traceback (most recent call last): File "vm_power.py", line 7, in progress = session.machine.launch_vm_process() File "/usr/local/lib/python2.7/dist-packages/virtualbox/library.py", line 27044, in machine ret = self._get_attr("machine") File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_base.py", line 165, in _get_attr attr = self._search_attr(name, prefix='get') File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_base.py", line 152, in _search_attr attr = getattr(self._i, attr_name, self) File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/init.py", line 381, in getattr return getattr(interface, attr) File "/usr/lib/virtualbox/sdk/bindings/xpcom/python/xpcom/client/init.py", line 467, in getattr return XPTC_InvokeByIndex(self.comobj, method_index, args) xpcom.Exception: 0x8000ffff (The session is not locked (session state: Unlocked))

How do you lock the machine as you said prior to running the above script?

Thanks for the help on this.

On Fri, Sep 14, 2018 at 10:19 AM Seth M. Larson [email protected] wrote:

I'll play around with this when I get time and give you a better answer. Typically when you have a machine that you want to lock you use the session.machine object rather than the original machine instance you used to lock with the session. It's confusing I know.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SethMichaelLarson/virtualbox-python/issues/117#issuecomment-421426509, or mute the thread https://github.com/notifications/unsubscribe-auth/AZGFdYom1AmnRSoHYkGdk_PIEqzSNrlHks5ua-UXgaJpZM4WoaZ3 .

gmatano avatar Sep 14 '18 18:09 gmatano

Look at the documentation for Session.lock_machine().

sethmlarson avatar Sep 14 '18 18:09 sethmlarson

Ran this:

import virtualbox

vbox = virtualbox.VirtualBox() print("VM(s):\n + %s" % "\n + ".join([vm.name for vm in vbox.machines])) s = virtualbox.Session() vm.lock_machine(s, virtualbox.library.LockType.shared) vm = vbox.find_machine('U') progress = s.machine.launch_vm_process()

Got this:

VM(s):

  • U Traceback (most recent call last): File "vm_power.py", line 8, in progress = s.machine.launch_vm_process() File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_ext/machine.py", line 183, in launch_vm_process type_p, environment) File "/usr/local/lib/python2.7/dist-packages/virtualbox/library.py", line 11719, in launch_vm_process in_p=[session, name, environment]) File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_base.py", line 186, in _call return self._call_method(method, in_p=in_p) File "/usr/local/lib/python2.7/dist-packages/virtualbox/library_base.py", line 213, in _call_method raise errobj virtualbox.library.VBoxErrorInvalidObjectState: 0x80bb0007 (The machine 'U' is already locked by a session (or being locked or unlocked)) Segmentation fault (core dumped)

Not sure if I structured the above script correctly.

gmatano avatar Sep 14 '18 21:09 gmatano