Automatically chdir to vagrant directory upon "vagrant ssh"
I put
echo "cd /vagrant_projects/my-project" >> /home/vagrant/.bashrc
in my provision.sh
, and it works like a charm.
You can do this by using the config.ssh.extra_args
setting in your Vagrantfile:
config.ssh.extra_args = ["-t", "cd /vagrant; bash --login"]
Then anytime you run vagrant ssh
you will be in the /vagrant
directory.