Vagrant 2.2.0
Windows 10
Error on Vagrant boxes minimal/xenial64 and bento/ubuntu-18.10 running Ubuntu-16.04 and Ubuntu-18.10 respectively using Virtualbox 5.2.220.
I have been using this VagrantFile to configure my guest vm environment for about 7 months now and recently decided I would add the shared folder functionality. Nothing else has changed. I have a few git repos on my host computer that I use my vagrant vm to compile and run. The shared folder changes bring the folders into the vm however when I try to execute a python command I get "-bash: ./aws_setenv.py: /usr/bin/python^M: bad interpreter: No such file or directory". This is the same error I get if I run the command on my host vm. I ran a few experiments, syncing some folders and not others on the same vm. The synced folders could not run my scripts but the non synced folders worked as expected.
In the code snippet of the change I made below I use #{params['ansible_promote_repo']} with YAML.load to parse a text file for the Host VM repo location. It works throughout the rest of the Vagrantfile for other needed vars. And the synced folder appears on the guest vm but just does not allow me to run my work.
I have also ran tests using rsync but recieved the same error.
Snippet:
config.vm.synced_folder "#{params['ansible_repo']}", "/home/vagrant/ansible-promote"
-bash: ./aws_setenv.py: /usr/bin/python^M: bad interpreter: No such file or directory
https://www.vagrantup.com/docs/synced-folders/
It seems the synced folder is using the resources on my host computer.
Any help will be appreciated. Am I missing something? and please let me know if there is any other details I can provide.
Thanks
Most helpful comment
Hey Hey @briancain , you were absolutely correct. Running "sed -i -e 's/r$//'
All 3 comments
Hi @Hajamu - Just based on the error you are getting, I think Vagrant is working as expected. This looks to be an error from Bash on Ubuntu complaining about your script file having windows line endings:
I'm guessing if you fix the line endings, the error will go away.
If you are still experiencing an issue after following those posts feel free to open a new one or ping on here and we can reopen it. Thanks!
Hey Hey @briancain , you were absolutely correct. Running "sed -i -e 's/r$//'