SSH into your VM directly
vagrant ssh to SSH into your VM directly, as it’ll always do
the right thing.
If you need direct access (for
scp or similar), you’ll need to
manually configure your SSH configuration:
vagrant ssh-config --host dev
- Paste the output into your
- SSH into this using
Reverse port forwarding
If you need access to a specific port outside your VM, you can add a reverse port option when SSHing into the VM.
For example, if you have a Docker image running on your host machine on port
5678, use the following option to allow an app inside the VM to access it on port
vagrant ssh -- -R 1234:localhost:5678