Skip to content

Instantly share code, notes, and snippets.

@hsiboy
Last active May 28, 2022 21:59
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hsiboy/7ef27ab2f14e76f5c3f4 to your computer and use it in GitHub Desktop.
Save hsiboy/7ef27ab2f14e76f5c3f4 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...

Other issues:

VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)

Solution: After the vm exports the .ovf, use the vbox to open the .vmdk. You don't have to import .ovf.

In windows you can kill the VboxHeadless.exe process in task manager. CMD prompt was opened in Administrative mode.

@mtrebi
Copy link

mtrebi commented Aug 13, 2015

Thanks! It fixed my problem

@xandkar
Copy link

xandkar commented Aug 17, 2015

@hsiboy Thanks! This helped me as well. Found via Google.

Copy link

ghost commented Sep 9, 2015

The suggestions above didn't help in my case. I could fix as follow:

Problem
Fehlercode:VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)
Komponente:ProgressProxy
Interface:IProgress {UUID}

Fix
1.) Create a clone
2.) Choose linked Clone (Verknüpfter Klon)

@chriscupas
Copy link

That did the trick...

@alexszilagyi
Copy link

alexszilagyi commented Mar 6, 2016

@hsiboy: How you'd run the command in windows command prompt? How I can specify the space between program & files, the path is:
C:\Windows\system32>C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm default.

I don't know how to specify the space between Program and Files.


in windows you can represent Program Files as Progra~1

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

or wrap the whole thing in "" quotes.

@peets
Copy link

peets commented Sep 8, 2016

Thanks! This ranks high in Google and solved my problem.

@1am
Copy link

1am commented Feb 8, 2018

❤️
Thank you

@zhoushenglin
Copy link

我的失败代码是:VBOX_E_INVALID_OBJECT_STATE (0x80BB0007)
解决方法:
vm导出.ovf之后直接使用vbox打开.vmdk。不必导入.ovf。

@Kocal
Copy link

Kocal commented Jul 29, 2019

Thanks! :)

@Magomogo
Copy link

Magomogo commented Oct 4, 2019

Thanks!

@rbarakjsonar
Copy link

Any idea what could cause a VirtualBox guest to enter the VBOX_E_INVALID_OBJECT_STATE state?

@ashish807
Copy link

ashish807 commented Jul 2, 2020

its saying "Access is denied"
Any solution for this


Run the command window as administrator.

@ashish807
Copy link

ashish807 commented Jul 2, 2020

C:\WINDOWS\system32>C:\Progra~1\Oracle\VirtualBox\VBoxManage.exe controlvm default poweroff

VBoxManage.exe: error: Could not find a registered machine named 'default'
VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown
VBoxManage.exe: error: Context: "FindMachine(Bstr(a->argv[0]).raw(), machine.asOutParam())" at line 383 of file VBoxManageControlVM.cpp

Any Solution


There is a clue in the error message.
"Could not find a registered machine named 'default'"

What is your machine name?

@Dorbah
Copy link

Dorbah commented Aug 20, 2020

Right mouse click on virtual machine and select "Create shortcut on Desktop" then open properties of this shortcut and in command line you will see your machine name like "41fdff23-d740-47c0-898e-0f62c2c8b056" ( "C:\Program Files\Oracle\VirtualBox\VirtualBoxVM.exe" --comment "bitnami-gitlab" --startvm "41fdff23-d740-47c0-898e-0f62c2c8b056" )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment