Vagrant WSL rsync和ssh权限错误

我有一个非常奇怪的问题,尽pipe它的自我解释,我在WSL中使用rsync和stream浪ssh时仍然有权限问题。

我在Windows和WSL中都安装了stream浪版本1.9.8。 我导出了以下环境variables:

export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1" export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/Vagrant" 

当我运行vagrant up它成功地在virtualbox中创build一个虚拟机。 但中途我得到以下错误:

 ==> salt: Rsyncing folder: /mnt/c/Vagrant/ => /vagrant There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info. Host path: /mnt/c/Vagrant/ Guest path: /vagrant Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2222 -o LogLevel=FATAL -o ControlMaster=auto -o ControlPath=/tmp/ssh.216 -o ControlPersist=10m -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i '/mnt/c/Vagrant/.vagrant.d/insecure_private_key'" "--exclude" ".vagrant/" "/mnt/c/Vagrant/" "[email protected]:/vagrant" Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0] 

当我使用vagrant ssh salt我得到的错误:

 Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 

不pipe我用什么样的Vagrantfile。 当我把Vagrantfile放在WSL的/ root下时,我可以使用vagrant ssh ,但是我仍然得到rsync的错误。

这真是太奇怪了,因为Vagrant的WSL文档是这样说的:

 Other useful WSL related environment variables: VAGRANT_WSL_WINDOWS_ACCESS_USER - Override current Windows username VAGRANT_WSL_DISABLE_VAGRANT_HOME - Do not modify the VAGRANT_HOME variable VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH - Custom Windows system home path 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 the VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH environment variable. For example, if a user wants to run a Vagrant project from the WSL that is located at C:\TestDir\vagrant-project: 

有谁知道如何解决这个问题? 或者有谁自己经历过这个问题? 我希望有人能帮助我。