vagrant ssh can be slow because it boots up a ruby process, does a bunch of analysis to determine your ssh parameters, and then actually invokes the command. If you want a faster login, try the following:
# Compute the ssh parameters, append them to your global ssh config file # The --host parameter specifies what you want the vagrant machine to be called vagrant ssh-config --host vagrant >> ~/.ssh/config # Now just ssh into that machine directly ssh vagrant
A couple caveats:
- Vagrant still needs to be running for you to ssh into it.
vagrant sshfails with a helpful error message when the machine isn't running, while
ssh vagrantwill just fail silently. Not super helpful.
- If you do a bunch of fiddling with vagrant, it's possible that the parameters in your .ssh/config file may become out of date. I've been running this configuration for several months now without any problems but ymmv. To fix that issue, open your .ssh/config file, delete the block that starts with "Host vagrant" and then run the first command again.