How can I connect Filezilla to a Vagrant VM?

On my machine (windows) the default is for Vagrant's sftp to be available on port 2222. So, from Filezilla, I use:

  • host: 127.0.0.1
  • port: 2222
  • protocol: sftp
  • logon type: normal (with the default user and password being "vagrant")

By default as already described by Darius in his answer you can connect to a vagrant VM using the IP 127.0.0.1 (which is your localhost) and the port 2222, with the username vagrant and password vagrant, using any ssh or sftp client.

If you get the following error: Disconnected: No supported authentication methods available (server sent: publickey) then you can fix this problem easily. The reason for this error is that nowadays vagrant is often configured to use a public-key authentication, which is described in this article: https://www.ssh.com/ssh/public-key-authentication

But this doesn't need to be a problem, we can just use the private key stored in the vagrant configuration directory to authenticate to the virtual machine with almost any sftp client. In your sftp-client (personally using WinSCP for example) select the private key file from the following location: C:\Path\To\VagrantVM\.vagrant\machines\default\virtualbox\private_key

Make sure to replace C:\Path\To\VagrantVM\ with the actual path on your machine.

Enter the username vagrant and click connect, which should successfully open a connection to the vagrant VM.