使用 Laravel Homestead 的新安装,我一直在尝试启动 Vagrant,但它一直超时。我尝试使用默认的虚拟交换机
我知道我可以将提供程序保留为 VirtualBox 并关闭 Hyper-V,但由于我们在不同应用程序中使用 Vagrant 和 Docker,因此在过去几天中,这样做变得很繁琐,因为 Windows 10 Pro 上的
有没有人使用 Hyper-V 提供程序成功地运行 Laravel Homestead,并且你需要采取哪些步骤来使网络工作正常,这似乎是问题的原因?
Default
,以及我使用 Hyper-V Manager 添加的虚拟交换机 DockerNAT
和 NewInternalVirtualSwitch
。我知道我可以将提供程序保留为 VirtualBox 并关闭 Hyper-V,但由于我们在不同应用程序中使用 Vagrant 和 Docker,因此在过去几天中,这样做变得很繁琐,因为 Windows 10 Pro 上的
Docker for Windows
需要开启 Hyper-V,所以每次你必须在两者之间关机和重启。有没有人使用 Hyper-V 提供程序成功地运行 Laravel Homestead,并且你需要采取哪些步骤来使网络工作正常,这似乎是问题的原因?
Homestead.yaml
ip: 192.168.10.10
memory: 2048
cpus: 1
provider: hyperv
authorize: ~/.ssh/example/id_rsa.pub
keys:
- ~/.ssh/example/id_rsa
folders:
-
map: 'D:\Projects\example\server'
to: /home/vagrant/server
sites:
-
map: server.app
to: /home/vagrant/server/public
databases:
- example
name: example
hostname: example
Vagrant Up
Bringing machine 'example' up with 'hyperv' provider...
==> example: Verifying Hyper-V is enabled...
==> example: Importing a Hyper-V instance
example: Please choose a switch to attach to your Hyper-V instance.
example: If none of these are appropriate, please open the Hyper-V manager
example: to create a new virtual switch.
example:
example: 1) DockerNAT
example: 2) Default Switch
example: 3) NewInternalVirtualSwitch
example:
example: What switch would you like to use? 3
example: Cloning virtual hard drive...
example: Creating and registering the VM...
example: Setting VM Integration Services
example: Successfully imported a VM with name: ubuntu-16.04-amd64_1
==> example: Starting the machine...
==> example: Waiting for the machine to report its IP address...
example: Timeout: 120 seconds
example: IP: fe80::215:5dff:fe38:107
==> example: Waiting for machine to boot. This may take a few minutes...
example: SSH address: fe80::215:5dff:fe38:107:22
example: SSH username: vagrant
example: SSH auth method: private key <--- Stalls out for a couple minutes
错误
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.
更新
我也尝试了使用外部虚拟开关提示4,这使它更进一步,但在尝试分配主机名时仍然会出现错误:
==> example: Machine booted and ready!
==> example: Setting hostname...
No host IP was given to the Vagrant core NFS helper. This is
an internal error that should be reported as a bug.