ssh - 到Vagrant Homestead盒子的SSH连接超时

标签 ssh vagrant virtualbox

我正在学习如何使用可随时使用Homestead的Laravel 4.2。我以前使用Apache在本地学习Laravel。使用official docs设置Homestead时,我一直遇到超时。

我正在使用Vagrant 1.6.3,Homestead的最新版本(截至2014年7月10日),PHP 5.5.3(这应该没关系,因为我想使用的是Vagrant吗?)和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时,收到以下输出:
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.

我以前的Apache设置会干扰吗?我错过了什么?谢谢。

最佳答案

我遇到了同样的问题“超时...”,直到我发现计算机的BIOS中禁用了虚拟化兼容性。
采购该荧光粉。 http://laravel.io/forum/05-18-2014-trouble-getting-homestead-to-start-in-windows?page=1#reply-9067

修复了它的完美工作。

关于ssh - 到Vagrant Homestead盒子的SSH连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24695780/

相关文章:

selenium - 通过 SSH 运行测试 NG Selenium 测试

php - 在 Homestead 中运行 Vagrant 的问题

virtualbox - 无法连接到 headless virtualbox-ose : rfbProcessClientProtocolVersion: not a valid RFB client

ios - 将 ios 应用程序上传到 itunesconnect 时出错 "failed to open ssh session (16)"

xcode - 使用 Xcode 4.6 通过 SSH 推送到 GIT 存储库

ssh - Vagrant ssh:软件导致连接中止

ruby - 使用 Vagrant 的多个 EC2 实例

android - Genymotion 无法加载 VirtualBox 引擎

linux - PSSH直接到目录