Error: The machine 'Windows8.1' is already locked by a session

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

Error: The machine 'Windows8.1' is already locked by a session

Post by Plagrö »

Hello,

Sometimes I get the following message:

Code: Select all

VBoxManage: error: The machine 'Windows8.1' is already locked by a session (or being locked or unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), ComSafeArrayAsInParam(aBstrEnv), progress.asOutParam())" at line 727 of file VBoxManageMisc.cpp
How to reproduce:
I always use: "Save the state of the virtual machine" to end ma VM session.

0. My VM was closed with "Save the state of the virtual machine"
1. I start my VM with a command in my *.sh script.
2. When my VM is started, I wait only A FEW SECONDS and then I choose manually "Save the state of the virtual machine" to shut my VM down.
3. I start my VM again with the command in my *.sh script.
4. Now I get the message above and my VM does not start in a way as expected.

--> to step 2): When I wait longer, before I choose "Save the state of the virtual machine" (for example 5 min) to shut my VM down, I do not have this issue.

5. When I then shut it down normal (Switch off), and start it new, I get again this message, when I run the command. However, unlike step 4), the VM now works in a way as expected.
6. To get totally rid of this issue, I have to start Linux new.

What does this message mean?
What can I do, to pretend this message?
Do I have to start a service or do I have to exit a service?
Has this something to do with "virtual Box extensions pack"?

VirtualBox version: Version 6.1.30_Debian r148432

Would appreciate some help. Thank you.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Error: The machine 'Windows8.1' is already locked by a session

Post by scottgus1 »

Plagrö wrote:What does this message mean?
It means the VM is still doing something and you can't do to it yet what you tried to do. The earlier process needs to finish first:
Plagrö wrote:When I wait longer, before I choose "Save the state of the virtual machine" (for example 5 min) to shut my VM down, I do not have this issue.
The first process is done now, so the second can start.
Plagrö wrote:What can I do
Wait in a script loop until the first process is complete.

Run a "Vboxmanage showvminfo" on the VM, monitored for the "State:" line, to give you an idea of the VM's state during the processes your script is running.

Then after starting step 1 in the script, run a loop in the script after step 1, waiting for the VM State that shows when step 1 is complete. Then proceed to step 2.
Plagrö
Posts: 140
Joined: 27. May 2018, 14:57

Re: Error: The machine 'Windows8.1' is already locked by a session

Post by Plagrö »

Thank you.
Post Reply