Vagrant Halt force shutdown behavior #3895

Closed
abraithwaite opened this Issue May 23, 2014 · 10 comments

Comments

Projects
None yet
@abraithwaite

When running vagrant halt on vagrant 1.5.4, if the guest cannot be shutdown cleanly, a forced halt is run immediately without user intervention.

Personally, I would expect that if the guest cannot be shutdown cleanly then vagrant would simply exit non-zero with a descriptive error.

It would make more sense to me to have a non-zero exit status perhaps suggesting that the user runs vagrant halt --force if the guest is truly in an unrecoverable state.

Does this ring with anybody else?

@herlon214

This comment has been minimized.

Show comment
Hide comment
@herlon214

herlon214 May 24, 2014

It happened with me too.
I tried to shutdown my VM but it still up (at the VirtualBox screen). I tried to power on with "vagrant up" and it gives me the error:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'puphpet/centos65-x64' 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", "059021af-07f0-4c9f-ae7a-af034db9d6ea", "--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp566
7"]

Stderr: VBoxManage.EXE: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.EXE: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknow
n
VBoxManage.EXE: error: Context: "LockMachine(a->session, LockType_Write)" at line 462 of file VBoxManageModifyVM.cpp

It happened with me too.
I tried to shutdown my VM but it still up (at the VirtualBox screen). I tried to power on with "vagrant up" and it gives me the error:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'puphpet/centos65-x64' 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", "059021af-07f0-4c9f-ae7a-af034db9d6ea", "--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp566
7"]

Stderr: VBoxManage.EXE: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.EXE: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknow
n
VBoxManage.EXE: error: Context: "LockMachine(a->session, LockType_Write)" at line 462 of file VBoxManageModifyVM.cpp

@mitchellh

This comment has been minimized.

Show comment
Hide comment
@mitchellh

mitchellh May 24, 2014

Member

I've considered this a few times and was surprised no one asked for this before. I think we can come up with something to make this work.

Member

mitchellh commented May 24, 2014

I've considered this a few times and was surprised no one asked for this before. I think we can come up with something to make this work.

@iLukey

This comment has been minimized.

Show comment
Hide comment
@iLukey

iLukey Jun 26, 2014

Out of interest, did you ever manage to find a fix for this? I deleted all of my previous Vagrant config files yesterday (including the VMs themselves, which took the databases with them as well, and then I deleted all Vagrant config stuff), and for a while it worked.

I use PuPHPet, i fthat's of any consequence, and this happened after I added another vhost and tried to run 'vagrant reload --provision'. I've not really found any pattern to it besides the fact that it seems to happen when I add new vhosts, or possibly when there's been a syntax error in the PuPHPet file, and then you try?

Thanks!

iLukey commented Jun 26, 2014

Out of interest, did you ever manage to find a fix for this? I deleted all of my previous Vagrant config files yesterday (including the VMs themselves, which took the databases with them as well, and then I deleted all Vagrant config stuff), and for a while it worked.

I use PuPHPet, i fthat's of any consequence, and this happened after I added another vhost and tried to run 'vagrant reload --provision'. I've not really found any pattern to it besides the fact that it seems to happen when I add new vhosts, or possibly when there's been a syntax error in the PuPHPet file, and then you try?

Thanks!

@mitchellh mitchellh added the core label Oct 24, 2014

@stalal

This comment has been minimized.

Show comment
Hide comment
@stalal

stalal Nov 8, 2014

I can confirm the issue on vagrant 1.6.5. This is what I get:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "1edcca0b-1edd-457a-8e21-dfb9491afa24", "--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp6054", "--natpf1", "delete", "tcp8080"]

Stderr: VBoxManage.exe: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.exe: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 471 of file VBoxManageModifyVM.cpp

stalal commented Nov 8, 2014

I can confirm the issue on vagrant 1.6.5. This is what I get:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["modifyvm", "1edcca0b-1edd-457a-8e21-dfb9491afa24", "--natpf1", "delete", "ssh", "--natpf1", "delete", "tcp6054", "--natpf1", "delete", "tcp8080"]

Stderr: VBoxManage.exe: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.exe: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 471 of file VBoxManageModifyVM.cpp
@rhchristian

This comment has been minimized.

Show comment
Hide comment
@rhchristian

rhchristian Feb 7, 2015

Its NOT a solution.


i had this problem when i was running a vagrant machine and i closed the prompt(normal mode), when i opened the prompt again, i switched the prompt to run as administrator so get this error, so i closed the admin prompt(run as administrator), and open another one in a normal mode, i tested the "vagrant ssh" and this problem disappeared.

Its NOT a solution.


i had this problem when i was running a vagrant machine and i closed the prompt(normal mode), when i opened the prompt again, i switched the prompt to run as administrator so get this error, so i closed the admin prompt(run as administrator), and open another one in a normal mode, i tested the "vagrant ssh" and this problem disappeared.
@maxdeivys

This comment has been minimized.

Show comment
Hide comment
@maxdeivys

maxdeivys Apr 3, 2015

VBoxManage startvm [vm_id|vm_name] --type emergencystop

VBoxManage startvm [vm_id|vm_name] --type emergencystop

@terbooter

This comment has been minimized.

Show comment
Hide comment
@terbooter

terbooter Jun 4, 2015

Same error in Admin mode

C:\ubuntu>vagrant reload
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '14.04'. The latest is version '20150530.0.2'. Run
==> default: `vagrant box update` to update.
==> 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", "26aa704c-366d-4d7c-a6f0-14ae1df6cab6", "--natpf1", "delete", "ssh"]

Stderr: VBoxManage.exe: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.exe: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 471 of file VBoxManageModifyVM.cpp

It works perfect, but after PC reboot I cant up my vagrant box

Same error in Admin mode

C:\ubuntu>vagrant reload
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '14.04'. The latest is version '20150530.0.2'. Run
==> default: `vagrant box update` to update.
==> 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", "26aa704c-366d-4d7c-a6f0-14ae1df6cab6", "--natpf1", "delete", "ssh"]

Stderr: VBoxManage.exe: error: Failed to assign the machine to the session (E_FAIL)
VBoxManage.exe: error: Details: code VBOX_E_VM_ERROR (0x80bb0003), component Machine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "LockMachine(a->session, LockType_Write)" at line 471 of file VBoxManageModifyVM.cpp

It works perfect, but after PC reboot I cant up my vagrant box

@seperman

This comment has been minimized.

Show comment
Hide comment
@seperman

seperman Aug 17, 2015

I get this error on Win 7, Vagrant 1.6.5 when I switch between running in admin mode vs. normal mode.

I get this error on Win 7, Vagrant 1.6.5 when I switch between running in admin mode vs. normal mode.

@chrisroberts chrisroberts added this to the 1.9 milestone Sep 30, 2016

@davidshq

This comment has been minimized.

Show comment
Hide comment
@davidshq

davidshq Oct 17, 2016

I also get this error, when running in normal mode, admin mode seems to fix.

If writing a fix for this isn't possible/too difficult, suggest friendly error messaging, e.g. "Please reset your console in administrative mode if running on Windows."

I also get this error, when running in normal mode, admin mode seems to fix.

If writing a fix for this isn't possible/too difficult, suggest friendly error messaging, e.g. "Please reset your console in administrative mode if running on Windows."

@chrisroberts

This comment has been minimized.

Show comment
Hide comment
@chrisroberts

chrisroberts Dec 8, 2016

Collaborator

Hi there,

We would really like this, but this issue has been open for over a year with no one working on it, Leaving it open is unfortunately making our issue count look higher than it is. I’m going to close this and if someone wants to work on it I’d still be open to a PR!

Cheers!

Collaborator

chrisroberts commented Dec 8, 2016

Hi there,

We would really like this, but this issue has been open for over a year with no one working on it, Leaving it open is unfortunately making our issue count look higher than it is. I’m going to close this and if someone wants to work on it I’d still be open to a PR!

Cheers!

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