Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant Halt force shutdown behavior #3895

Closed
abraithwaite opened this issue May 23, 2014 · 11 comments
Closed

Vagrant Halt force shutdown behavior #3895

abraithwaite opened this issue May 23, 2014 · 11 comments

Comments

@abraithwaite
Copy link
Contributor

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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link

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
Copy link

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
Copy link

VBoxManage startvm [vm_id|vm_name] --type emergencystop

@terbooter
Copy link

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
Copy link

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
Copy link

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
Copy link
Member

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!

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests