设置 Homestead 时 Vagrant 不会运行

Mil*_*iez 3 ssh vagrant

我完成了本手册中有关如何设置 Homestead 的所有步骤 当我尝试运行 vagrant box 时,我遇到了问题:

mysystem@me:~/Google Drive/Homestead$ vagrant up
Vagrant failed to initialize at a very early stage:

The home directory you specified is not accessible. The home
directory that Vagrant uses must be both readable and writable.

You specified: /home/mysystem/.vagrant.d
Run Code Online (Sandbox Code Playgroud)

我尝试将 Homestead 文件夹放在系统的不同位置。Google Drive 文件夹是可读/可写的 - 我在没有 sudo 命令的情况下在那里创建文件/文件夹。也许我不是想解决正确的问题,我不知道。这是我的 Homestead.yaml 文件:

authorize: ~/Google\ Drive/Homestead/.ssh/id_rsa.pub

keys:
    - ~/Google\ Drive/Homestead/.ssh/id_rsa

folders:
    - map: ~/Google\ Drive/Homestead/workspace
      to: /home/vagrant/Code

sites:
    - map: test.app
      to: /home/vagrant/Code/test/public

variables:
    - key: APP_ENV
      value: local
Run Code Online (Sandbox Code Playgroud)

我生成的 SSH 密钥文件是 ~/Google\ Drive/Homestead/homestead_key.pub

Mil*_*iez 5

好的,对于那些可能有同样问题的人,这里是它的解决方案和解释:

运行该命令whoami; ls -dlah ~/.vagrant.d/向我显示drwxr-xr-x 7 root root结果表明 vagrant 文件夹归 root 所有,这导致它无法访问的问题。

该命令sudo chown -R yourusername:yourusername ~/.vagrant.d将解决问题。:)