Using Vagrant with Git Bash on Windows 8

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using Vagrant with Git Bash on Windows 8

Stiles Watson
I installed Vagrant v1.2.2, VirtualBox 4.2.12 and Git bash 1.8.2.1 on Win 8. After installation, I started following the getting started instructions but got stuck on the provisioning step. After creating the bootstrap.sh file and run vagrant up, I get the ": No such file or directory" error on  chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell:

Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] Running provisioner: shell...
[default] Running: c:/Users/Stiles/vagrant_getting_started/bootstrap.sh
stdin: is not a tty
/usr/bin/env:
bash
: No such file or directory

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell


If I run $vagrant ssh and then run $ls -al /tmp/vagrant-shell, I get the following:
-rwxrwxr-x 1 vagrant vagrant 161 Apr 25 18:34 /tmp/vagrant-shell

If I run the chmod command above I get the same "No such file or directory" error:

$chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
: No such file or directory

When I look at the vagrant-shell file, I notice that it has the extra carriage-return Windows char at the end of each line.

My workaround was to open bootstrap.sh with vi in git-bash and set the file type to unix instead of dos (:set ff=unix) and then save (:wq). Now provisioning is working.

Whatever process is being used to copy bootstrap.sh to /tmp/vagrant-shell is not converting the file.

Stiles

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.