hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.01k stars 4.42k forks source link

Allow Virtualbox provider to tolerate a "paused" state for brief period of time #13410

Open enthusedcoder opened 3 weeks ago

enthusedcoder commented 3 weeks ago

Is your feature request related to a problem? Please describe.

So, I have a Ubuntu-based, virtualbox vagrant box that I am trying to successfully deploy, but have been having some intermittent issues that are cropping up. I should note that this vagrant box is deployed headless and does not initially display the GUI for the VM, but, in order to attempt to troubleshoot why Vagrant intermittently times out when attempting to connect to the box via ssh, I will open the GUI for vm instance that vagrant is attempting to deploy to see if I can spot any notable behavior:

image

However, it is here where we run into issues. If I want to close the GUI for the vm instance again, attempting to close the GUI will result in the below prompt:

image

As you can see, one of the options will allow the virtualbox to continue running the vm in the background, but the vagrant deployment process has already failed at this point. The error vagrant is producing is as follows:

The guest machine entered an invalid state while waiting for it to boot. Valid states are 'starting, running'. The machine is in the 'paused' state. Please verify everything is configured properly and try again.

The error message even goes on to ironically suggest that the user open the GUI of the deployed machine to see if any helpful error messages can be observed. It would appear that the simple act of attempting to close the gui (which is what brings up the menu seen in the above picture) is the action that is putting the deployed vm in a paused state, and I wanted to suggest that vagrant be a little more tolerant of vms that are in a paused state (maybe only error out if the vm is detected to have been in a paused state for over 5 seconds or something) to allow user's to close the GUI to their vagrant vm instance without vagrant erroring out.

Describe the solution you'd like

It would appear that the simple act of attempting to close the gui (which is what brings up the menu seen in the above picture) is the action that is putting the deployed vm in a paused state, and I wanted to suggest that vagrant be a little more tolerant of vms that are in a paused state (maybe only error out if the vm is detected to have been in a paused state for over 5 seconds or something) to allow user's to close the GUI to their vagrant vm instance without vagrant erroring out.

Describe alternatives you've considered

None

Additional context

image