I'm trying to create a script that will bring up my vagrant VM (a Ubuntu box hosted on OSX) navigate to the correct directory and start up my virtual env. I've read that this command should work for me:

vagrant ssh -- -t 'some commands'

The commands execute correctly, I see their output, but then the connection closes as soon as the script or statement is done executing. Here is the exact statement I'm trying to run:

vagrant ssh -- -t 'source ~/env/bin/activate; cd /vagrant/refunite-web-touchpoint; pwd'

I get this output:

Connection to closed.

Here is the script for now:

vagrant up
vagrant ssh -- -t 'source ~/env/bin/activate; cd /vagrant/refunite-web-touchpoint; pwd'
  • vagrant currently doesn't support -tty so it simply refuses to accept the connection. That's why you see stdin: is not a tty error every time you run a vagrant provisioning process. – ddnomad Jul 9 '16 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.