Skip to content

Instantly share code, notes, and snippets.

@helix84
Forked from hsiboy/VBOX_E_INVALID_VM_STATE.md
Created June 20, 2016 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helix84/f63f99a1d3469444683f757ab7eb937c to your computer and use it in GitHub Desktop.
Save helix84/f63f99a1d3469444683f757ab7eb937c to your computer and use it in GitHub Desktop.
rescue a VM from VBOX_E_INVALID_OBJECT_STATE

#Issue

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "c8f076e7-b65f-4a48-9632-b65af0e27ba7", "--natpf1", "delet
e", "ssh"]

Stderr: VBoxManage.exe: error: The machine 'default' is
already locked for a session (or being unlocked)
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), c
omponent Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at lin
e 471 of file VBoxManageModifyVM.cpp

How to fix?

1st try and force power off of VM

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>VBoxManage.exe controlvm default poweroff
'VBoxManage.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Windows\system32>C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe controlvm default
poweroff
VBoxManage.exe: error: The virtual machine is being powered down
<b>VBoxManage.exe: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002)</b>, compo
nent Console, interface IConsole, callee IUnknown
VBoxManage.exe: error: Context: "PowerDown(progress.asOutParam())" at line 222 o
f file VBoxManageControlVM.cpp

ok, still have problem, lets try something else...

C:\Windows\system32>C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe startvm default
--type emergencystop

Fixed!

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment