Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Discussions related to using the OSE version of VirtualBox.
Post Reply
rbarak
Posts: 52
Joined: 25. Sep 2018, 20:43

Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by rbarak »

Has anyone compiled a list of reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

It seems that many encounter guests that from time to time enter VBOX_E_INVALID_VM_STATE, and all learn how to resolve this issue.* Alas, I couldn't find any discussion as to the possible root-causes for getting into this state.

Can we set a place on virtualbox.org where people would enter their guests' circumstances that led to VBOX_E_INVALID_VM_STATE so we could devise some possible root-causes?

--------
[*] How to get guest off VBOX_E_INVALID_VM_STATE
One executes VBoxManage list runningvms and then tries to poweroff one of the running guests:
$ VBoxManage controlvm drf-vb2 poweroff
only to get:
VBoxManage: error: The virtual machine is being powered down
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component ConsoleWrap, interface IConsole, callee nsISupports
VBoxManage: error: Context: "PowerDown(progress.asOutParam())" at line 577 of file VBoxManageControlVM.cpp


And then the only way of stopping the guest is by executing VBoxManage startvm "drf-vb2" --type emergencystop
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by scottgus1 »

rbarak wrote:Has anyone compiled a list of reasons
Probably not, unless it's the developers.

A google:
VBOX_E_INVALID_VM_STATE site:forums.virtualbox.org
will show several times this error has been discussed. You can peruse them to determine if there is a patttern.
rbarak
Posts: 52
Joined: 25. Sep 2018, 20:43

Re: Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by rbarak »

scottgus1 wrote:
rbarak wrote:Has anyone compiled a list of reasons
Probably not, unless it's the developers.

A google:
VBOX_E_INVALID_VM_STATE site:forums.virtualbox.org
will show several times this error has been discussed. You can peruse them to determine if there is a patttern.
I followed your good suggestion, and the only causes that make sense are too little memory or problems with VBoxSVC.
rbarak
Posts: 52
Joined: 25. Sep 2018, 20:43

Re: Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by rbarak »

I looked at the VBox sources on GitHub, and see that VBOX_E_INVALID_VM_STATE is a catchall error message that is applied in numerous situations, e.g., in the following methods (among others):

Code: Select all

resumeWithReason, pauseWithReason, enableVMMStatistics, onlineMergeMedium, enumerateGuestProperties, onUSBDeviceDetach, accessGuestProperty, onUSBDeviceAttach, onSharedFolderChange, onUSBControllerChange, onVRDEServerChange, onStorageDeviceChange, onMediumChange, onStorageControllerChange, onParallelPortChange, onSerialPortChange, onNetworkAdapterChange, uninitialize, updateMachineState, assignRemoteMachine, assignMachine (target: xpidl, midl), getRemoteConsole, removeDeviceFilter, createDeviceFilter, teleport, restoreSnapshot, deleteSnapshotRange, deleteSnapshotAndAllChildren, takeSnapshot, removeSharedFolder, etc.
Is there a reason that the same error is used in vastly different situations?

This makes it near impossible to know the reason why the guest entered the VBOX_E_INVALID_VM_STATE.

Wouldn't it be better to have individualised error results, linked to the method that produced them, e.g., VBOX_E_INVALID_VM_STATE_in_emoveSharedFolder or VBOX_E_INVALID_VM_STATE_in_takeSnapshot?
That way, the user will at least have an inkling why her guest VM entered the VBOX_E_INVALID_VM_STATE.

If I want to create a branch of the VBox codebase, where I'd implement individualised error messages, which documentation should I read to know which files in https://github.com/mirror/vbox should be changed?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by mpack »

Please don't put development questions in the user forums. Moving this topic to "VirtualBox OSE".
rbarak
Posts: 52
Joined: 25. Sep 2018, 20:43

Re: Reasons why a VirtualBox guest would transition to a VBOX_E_INVALID_VM_STATE?

Post by rbarak »

mpack wrote:Please don't put development questions in the user forums. Moving this topic to "VirtualBox OSE".
Could you please remove this thread from "VirtualBox OSE"?
I created a question in "VirtualBox OSE" (Why is VBOX_E_INVALID_VM_STATE used in vastly different situations?) without the unnecessary dialogue from the previous forum.
Post Reply