Vagrant up says "machine is already running" ... global-status says no active environment

Running Windows 10 Pro with VMware Workstation 15.5.
Here is the output of the vagrant “version” … “up” … “global-status” commands executed back to back. Running vagrant ssh brings me into the VMware guest no problem. Seems to me that the global-status command is not looking into the same places as the “up” command.

C:\PHPDev\Homestead\CRM>vagrant version
Installed Version: 2.2.9
Latest Version: 2.2.9

You're running an up-to-date version of Vagrant!

C:\PHPDev\Homestead\CRM>vagrant up
Bringing machine 'crm' up with 'vmware_desktop' provider...
==> crm: Checking if box 'laravel/homestead' version '9.5.1' is up to date...
==> crm: Machine is already running.

C:\PHPDev\Homestead\CRM>vagrant global-status
id       name   provider state  directory
--------------------------------------------------------------------
There are no active Vagrant environments on this computer! Or,
you haven't destroyed and recreated Vagrant environments that were
started with an older version of Vagrant.

GSImardCdm

Perhaps this is what is at play? With regard to the global-status command, from docs (link below):

This command does not actively verify the state of machines , and is instead based on a cache. Because of this, it is possible to see stale results (machines say they’re running but they’re not). For example, if you restart your computer, Vagrant would not know. To prune the invalid entries, run global status with the --prune flag.

Global-Status used to display some information, including a stale entry. I halted the running box and ran global-status --prune and the command correctly reported that no boxes were active. Since that point, I did bring a box up and down a few times and yet, global-status still report no active environment on the computer even when a box is up and running. Seems like the cache (where ever it is located) is not updated. It is not an issue for me but I now know that I cannot rely on the global-status command to know if a box is running on my computer. I have to use Task Manager and look for a vmware-vmx.exe process. If I were to not remember which box is running, I would have to run “vagrant status” from each environment folders until I find the one that report “{name} running (vmware_desktop)”

Hey there,
It looks like you maybe running into an issue similar to https://github.com/hashicorp/vagrant/issues/11187.
This was recently fixed with https://github.com/hashicorp/vagrant/pull/11656 and will be included in the next release of vagrant.

Cheers!

1 Like