简体   繁体   English

无业游民/家庭稳定-仅在家庭网络上连接超时

[英]vagrant / homestead up - connection timeout ONLY on home network

The problem 问题

Whenever I run vagrant up (or homestead up for Laravel Homestead 2.0) I get a connection timeout error as follows; 每当我跑vagrant up (或homestead up为Laravel宅基2.0)我收到一个连接超时错误如下:

(...usual 'vagrant up' stuff...)
==> 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: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: Connection timeout. Retrying...
    default: Error: 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.

(...left part out to reduce the size of this question...)

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Important 重要

Main key to this question is that this ONLY happens on my internet connection at home. 这个问题的主要关键是,这发生在我在家中的互联网连接上。 When I'm at the office (different network) everything runs as expected. 当我在办公室(不同的网络)时,一切都按预期运行。 So this means it has something to do with my home network / router...? 所以这意味着它与我的家庭网络/路由器有关...?

What I'm running 我在跑什么

  • Macbook Pro (late 2013) Macbook Pro(2013年末)
  • Mac OS X 10.10.1 Mac OS X 10.10.1
  • Router: Huawei HG556a with bridged Airport Extreme 路由器:华为HG556a,带桥接的Airport Extreme

What I've tried 我尝试过的

I've tried so many stuff that Google almost doesn't give me new results anymore on my search queries, here are the most important ones; 我已经尝试了很多东西,以至于Google在搜索查询中几乎不再给我新的结果,这是最重要的。

  • Destroyed the box 摧毁盒子
  • Completely uninstalled Vagrant & Virtualbox, and reinstalled the latest (and tried with combinations of older) versions. 完全卸载了Vagrant&Virtualbox,并重新安装了最新版本(并尝试使用较旧的版本)。
  • Increased the timeout to 600 and later 1200 超时增加到600,之后增加到1200
  • Setting fixed IPs in the Vagrantfile 在Vagrantfile中设置固定IP
  • Forwarded to different ports through the Vagrantfile 通过Vagrantfile转发到不同的端口
  • Set my mac to use the DNS 8.8.8.8 and 8.8.4.4 将我的Mac设置为使用DNS 8.8.8.88.8.4.4
  • Enabled the GUI which results in homestead login: , which is the same compared to when it works just fine at the office. 启用了导致homestead login:的GUI,与在办公室正常工作时相比,该效果相同。 Even tried logging in with user vagrant and pass vagrant 甚至尝试使用用户vagrant登录并通过vagrant

I really hope someone can give a working solution, I've seriously been at it a couple of days now... 我真的希望有人能给出一个可行的解决方案,我已经认真考虑了几天。

Of course, solutions and good answer will be rewarded with upvotes and marked as answer! 当然,解决方案和好的答案将得到奖励,并标记为答案!

Don't forget to add the "domains" for your Nginx sites to the hosts file on your machine! 不要忘记将Nginx站点的“域”添加到计算机上的hosts文件中! The hosts file will redirect your requests for the local domains into your Homestead environment. hosts文件会将您对本地域的请求重定向到您的Homestead环境中。 On Mac and Linux, this file is located at /etc/hosts. 在Mac和Linux上,此文件位于/ etc / hosts。 On Windows, it is located at C:\\Windows\\System32\\drivers\\etc\\hosts. 在Windows上,它位于C:\\ Windows \\ System32 \\ drivers \\ etc \\ hosts。 The lines you add to this file will look like the following: 您添加到此文件的行将如下所示:

192.168.10.10 homestead.app 192.168.10.10 homestead.app

In windows, you have to run notepad as an administrator when accessing and editing your etc/hosts file 在Windows中,访问和编辑etc / hosts文件时必须以管理员身份运行记事本

I had the same issue. 我遇到过同样的问题。 In my case I destroy the homestead box and recreated it and all work just fine since. 就我而言,我销毁了宅基地盒子并重新创建了它,自那以后一切正常。 I just ran the following: - homestead destroy - homestead up 我只运行了以下内容:-破坏宅基地-筑起宅基地

Hopes it helps. 希望能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM