Opened 7 years ago
Last modified 5 years ago
#17515 new defect
VBoxManager gets into a bad state
Reported by: | spongman | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.2.4 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Windows |
Description
simple repro on windows, foo.bat:
set VBOX="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
:loop %VBOX% controlvm "%1" poweroff %VBOX% snapshot "%1" restorecurrent %VBOX% startvm "%1"
goto loop
this results in a bunch off issues, including:
VBoxManage.exe: error: The machine 'box' is already locked by a session (or being locked or unlocked) VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown VBoxManage.exe: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), Bstr(strEnv).raw(), progress.asOutParam())" at line 600 of file VBoxManageMisc.cpp
VBoxManage.exe: error: Invalid machine state: PoweredOff (must be Running, Paused or Stuck) VBoxManage.exe: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component ConsoleWrap, interface IConsole, callee IUnknown VBoxManage.exe: error: Context: "PowerDown(progress.asOutParam())" at line 578 of file VBoxManageControlVM.cpp
and eventually it dies:
Progress state: E_ACCESSDENIED VBoxManage.exe: error: Snapshot operation failed VBoxManage.exe: error: The object is not ready VBoxManage.exe: error: Details: code E_ACCESSDENIED (0x80070005), component SessionMachine, interface IMachine VBoxManage.exe: error: Context: "enum RTEXITCODE cdecl handleSnapshot(struct HandlerArg *)" at line 539 of file VBoxManageSnapshot.cpp VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available) VBoxManage.exe: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), Bstr(strEnv).raw(), progress.asOutParam())" at line 600 of file VBoxManageMisc.cpp
at this point a full restart of all VBox processes is required.
Change History (3)
follow-up: 2 comment:1 by , 7 years ago
comment:2 by , 7 years ago
Replying to spongman:
ugh. why did it wrap the text?
Because you didn't tell it not to. Did you notice the "Preview" button next to the "Submit" one?
have you considered github?
I don't believe that this has anything to do with the ticket, or the formatting of the ticket, right? Am I missing something?
As far as the actual ticket, have you considered a "sleep" in between the steps? They *do* take a finite amount of time to execute, you'll need to account for it.
Maybe with another inner loop that checks the state of the VM? That's if you don't want to put a specific amount of sleep time...
comment:3 by , 5 years ago
I have the same issue with a Linux host (ubuntu 18.04) and Windows 7 guests. Error caused when using virtualbox with cuckoo sandbox
((ugh. why did it wrap the text? have you considered github?))