关注>> https://laravel.com/docs/5.3/homestead
bash init.sh
cp: overwrite '/c/Users/myuser/.homestead/Homestead.yaml'? y
cp: overwrite '/c/Users/myuser/.homestead/after.sh'?
cp: overwrite '/c/Users/myuser/.homestead/aliases'?
Homestead initialized!
我不知道这些是否需要被覆盖?
另外,我配置了homestead.yaml
文件夹:
- map: ~/Homestead
to: /home/vagrant/Code
显示错误[缺少共享文件夹的主机路径:〜/ Homestead]
我的家园安装是 $ pwd /宅
安装方法 - 每个项目安装
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Running provisioner: shell...
SSH authentication failed! This is typically caused by the public/private
keypair for the SSH user not being properly set on the guest VM. Please
verify that the guest VM is setup with the proper public key, and that
the private key path for Vagrant is setup properly as well.
这是一个全新的装置!
vagrant destroy&&达
default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Authentication failure. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
答案 0 :(得分:2)
是的,你应该覆盖这些文件,以便彻底安装Homestead(以防万一)。现在,您收到此错误的原因是您的YAML配置错误。假设您的Laravel代码位于Documents文件夹的Code文件夹中,您的YAML应该如下所示(注意:这是 Windows特定的!):
folders:
- map: "C:/Users/Username/Documents/Code"
to: "/home/vagrant/Code"
您需要将包含本地代码的文件夹映射到虚拟机中的文件夹。然后将使用共享文件夹设置此项。这样,您的代码文件夹中的任何代码更改都将镜像到您的VM。
就个人而言,我更喜欢Per Project安装,因为我可以在不同的VM上运行多个项目,同时映射到不同的域。请在此处查看:https://laravel.com/docs/5.3/homestead#per-project-installation