git bash under Windows 10 doesn't execute vagrant version
Asked Answered
M

1

0

Installed git version 2.35.1.windows.2 under Windows 10. From git bash, run: vagrant version. Opens up a dos window, executes, and closes. So I cannot use these types of commands, like vagrant version. 100% repeatable.

If I run git bash elevated, then I can see the command completes as expected.

Expected behavior from a Windows 10 machine that works, with git running not elevated:

vagrant version
Installed Version: 2.2.19
Latest Version: 2.2.19

Both machines, the one that works as expected and the one that fails, git was installed as regular user, with git being installing under: C:\Users<username>\AppData\Local\Programs\Git\git-bash.exe --cd-to-home

Mallarme answered 15/4, 2022 at 6:54 Comment(2)
I’m voting to close this question because, as the tag states: GENERAL VAGRANT SUPPORT IS OFF-TOPIC. Support questions may be asked on superuser.com.Becalmed
This is a git bash issue. It runs the command in a new window. This is the issue. vagrant version is a way to replicate, one use case that fails.Mallarme
C
0

Try, with the problematic PC, to use a simplified PATH and see if that works:

Open a CMD and type:

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set "GH=%LOCALAPPDATA%\Programs\Git"
set "PATH=%GH%\bin;%GH%\cmd;%GH%\usr\bin;%GH%\mingw64\bin;%GH%\mingw64\libexec\git-core;%PATH%"
set "PATH=C:\path\to\vagrant.exe;%PATH%"

Replace C:\path\to\vagrant.exe by the parent folder of vagrant.exe, do not include vagrant.exe itself in the %PATH%.

Test if the issue persists then in that CMD session.

bash
vagrant version
Cestus answered 15/4, 2022 at 8:12 Comment(17)
Should clarify that git bash doesn't work, git cmd does work. Once I get access to the machine that fails, I'll try your suggestion.Mallarme
@Mallarme With the simplified path I propose, you just type bash from a regular CMD, and you are in a git bash session.Cestus
Tried the scenario, with sets from CMD, same issue. vagrant version opens the dos window, then gets closed, but with no way to see the output. @VonC, thank you for the feedback so far.Mallarme
@Mallarme in the git bash session (from the CMD with simplified PATH), what does which vagran return? Is it a vagran shell script which in turn would call vagran.exe? Or is it directly vagran.exe?Cestus
it is vagrant.exe, not a scriptMallarme
ls -l /c/HashiCorp/Vagrant/bin/ total 2976 -rwxr-xr-x 1 selsetm 1049089 3045248 Nov 3 23:27 vagrant.exe*Mallarme
On a system that works, I get this: file /c/HashiCorp/Vagrant/bin/vagrant.exe /c/HashiCorp/Vagrant/bin/vagrant.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS WindowsMallarme
The programmer is gone for the weekend, I can get the same info from the machine that fails on Monday.Mallarme
Could git bash be effected when running 32-bit executable? The host itself is a 64-bit machine.Mallarme
@Mallarme Indeed. the vagrant_2.2.19_i686.msi would not give a working vagran.exe. vagrant_2.2.19_x86_64.msi would work for 64-bits OS.Cestus
The published msi to install is vagrant_2.2.19_x86_64. I'll observe the system while is installing vagrant but I think this is what the programmer did anyway.Mallarme
Note that the file command on vagrant was executed from machine that works as expected.Mallarme
which vagrant /c/HashiCorp/Vagrant/bin/vagrantMallarme
file /c/HashiCorp/Vagrant/bin/vagrant /c/HashiCorp/Vagrant/bin/vagrant: PE32+ executable (console) x86-64 (stripped to external PDB), for MS WindowsMallarme
so vagrant was installed correctlyMallarme
@Mallarme It does look the right version indeed. Do you see any other difference between this PC and the working PC?Cestus
Not sure where to look. I agree there is something different, just not sure what it would be. He had OneDrive installed, it was removed since. Looks like privileges issues to me. I am going to ask the developer to redo the vagrant installation and observe it while it is doing it. We already reinstalled git many times over.Mallarme

© 2022 - 2024 — McMap. All rights reserved.