Closed gmatano closed 1 year ago
You may want to try creating a Session
and locking the machine, then using the session.machine.launch_vm_process()
?
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 notifications@github.com 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 .
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.
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):
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 notifications@github.com 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 .
Look at the documentation for Session.lock_machine()
.
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):
Not sure if I structured the above script correctly.
I no longer have time to maintain this library, so am closing this issue.
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? YesSUMMARY
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.