OS is Debian 10, vagrant provider is libvirt.
vagrant global-status
is supposed to provide information on all vms on a system, but I can see shutoff and running vms in virt-manager that are not listed by vagrant global-status
. I have only used libvirt for Vagrant so I know Vagrant is the culprit.
How do I determine the associated directory/Vagrantfile for each of these vms?
I think this command would do the trick:
find / -name Vagrantfile -exec echo {} \; -exec bash -c 'cd "$(dirname {})" && vagrant status | grep -E shutoff\|running' \; 2>/dev/null
But it seems absurd that something like this would be necessary, and would take a very long time on a large filesystem.
How exactly can I determine the directory for the associated Vagrantfile for each vm? There must be an easier way besides exhaustively searching the filesystem.