我正在学习如何使用Laravel 4.2,它准备使用Homestead。我以前使用Apache在本地学习Laravel。在使用official docs设置Homestead时,我一直遇到超时。SSH连接到Vagrant Homestead框超时
我正在使用Vagrant 1.6.3,Homestead的最新版本(截至2014年7月10日),PHP 5.5.3(这应该不重要,因为我使用的是流浪我猜想?)和Laravel 4.2。
我用下面的Vagrantfile
:
VAGRANTFILE_API_VERSION = "2"
path = "#{File.dirname(__FILE__)}"
require 'yaml'
require path + '/scripts/homestead.rb'
Vagrant.configure("1") do |config|
config.vm.boot_mode = :gui
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
Homestead.configure(config, YAML::load(File.read(path + '/Homestead.yaml')))
end
我用下面Homestead.yaml
:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: /home/alex/.ssh/id_rsa.pub
keys:
- /home/alex/.ssh/id_rsa
folders:
- map: /home/alex/repos/www
to: /home/vagrant/repos/www
sites:
- map: homestead.app
to: /home/vagrant/repos/www/learning/public
我/etc/hosts
文件包含以下行:
127.0.0.1 learning.app
当我打电话vagrant up
,我收到了这个foll由于输出:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> 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: Connection timeout. Retrying...
[[17 more failed attempts]]
default: Warning: Connection timeout. 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.
能阿帕奇我以前的设立被干扰?我错过了什么?谢谢。
你有没有尝试过通过vbox gui手动启动盒子,然后通过普通shell连接到它? – Max
这是我第一次使用VirtualBox进行实时操作。我如何从GUI运行Homestead框? 编辑:我打开了VirtualBox的图形用户界面,看到我有几个家园箱,并试图打开一个。它只显示一个黑屏(现在超过五分钟)。 – ordonezalex
[Vagrant卡住连接超时重试]可能重复(http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying) – kenorb