Vagrant SSH Permissions
I just had this issue, and I worked around it moving the private_key file to another place, changing its permission, and then creating a symbolic link at the original place. So,
$ mv [...]/.vagrant/machines/default/virtualbox/private_key /some/path/where/you/can/change/permissions
$ ln -s /some/path/where/you/can/change/permissions [...]/.vagrant/machines/default/virtualbox/private_key
If you're using the Windows Subsystem for Linux (WSL), this error can occur when you're trying to vagrant up
in a directory that is outside the user's home directory.
From the Vagrant docs:
If a Vagrant project directory is not within the user's home directory on the Windows system, certain actions that include permission checks may fail (like
vagrant ssh
). When accessing Vagrant projects outside the WSL Vagrant will skip these permission checks when the project path is within the path defined in theVAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH
environment variable.
Changing the VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH
to the current working directory (or a directory above it) can fix this. For example, if your project is in /mnt/c/www
, then set the environment variable accordingly:
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/www"
I got the same error now. The problem happened because i was trying to do vagrant up in an NTFS partition, just like the error message tell me. So i created an directory link in my ext4 partition and an simbloc link in my NTFS to solve this. Works Fine now!
Thanks!