I have a problem where I can't do my vagrant up
in cygwin, because cygwin can't understand non-POSIX style paths like C:\
, which the vagrantfile uses.
I use git-bash
to start vagrant, because it can understand the non-POSIX paths. To make my life even simpler, I created windows .lnk
files to launch bash scripts in git-bash that start my ssh agent and start vagrant.
I wanted it to take a step further and use bash aliases in cygwin to create an alias for vagrant up
that would launch my vagrant-up.lnk
, etc, which in turn would launch a git-bash session and finally start my vagrant instance.
However, I am having a strange problem where I cannot launch .lnk
files with cygwin nor git-bash.
~/Desktop
$ cygstart vagrant-up.lnk
Unable to start 'vagrant-up.lnk': The specified path was not found.
Thinking it was a path issue, I tried giving the full path:
~/Desktop
$ cygstart -o /cygdrive/c/Documents\ and\ Settings/user/Desktop/vagrant-up.lnk
Unable to start 'C:\Documents and Settings\user\Desktop\vagrant-up.lnk': The operating system denied access to the specified file.
The error message seems more useful in git-bash
MINGW64 /c/Users/user/Desktop
$ ./vagrant-up.lnk
bash: ./vagrant-up.lnk: cannot execute binary file: Exec format error
I googled the "bash cannot execute binary file" error, but only found results about *nix utilities compiled for the wrong architecture (e.g. AIX on x86, etc)
On Timothy Martin's suggestion, I also tried this, to no avail:
$ cygstart /cygdrive/c/Users/user/Desktop/vagrant-up.lnk
Unable to start 'C:\Users\user\Desktop\vagrant-up.lnk': The specified path was not found.
It is interesting that it uses windows-style paths in this error message, but I don't know how to turn that fact into a resolution of my problem.
In the vagrant-up.lnk
, the Target:
is
"C:\Program Files\Git\git-bash.exe" -l "C:\cygwin\home\user\vagrant\scripts\vagrant-up.git-bash"
and Start in:
is in "C:\Program Files\Git"
.
What do I need to do to launch these .lnk
files from cygwin? They run just fine when I double-click them in Windows.
vagrant-up.lnk
have you triedcygstart /cygdrive/c/Users/user/Desktop/vagrant-up.lnk
? – Timothy Martin Feb 08 '17 at 22:15cygstart vagrant-up.bash
search for a program associated to.bash
extension and find nothing on windows extension database . Try justvagrant-up.bash
. Additional, have you put#!/bin/bash
at the beginning of the script ? – matzeri Feb 09 '17 at 07:05vagrant-up.bash
script that git-bash uses. I am trying to launch myvagrant-up.lnk
windows shortcut through cygwin. I have updated my question; sorry for the confusion. – user394 Feb 09 '17 at 14:23Target
and theStart in
of your windows link ? – matzeri Feb 09 '17 at 14:41C:\Users\user\Desktop\vagrant-up.lnk
work from CMD ? – matzeri Feb 09 '17 at 14:51