Laravel流浪了SSH问题 [英] Laravel Vagrant Up SSH Problems

查看:70
本文介绍了Laravel流浪了SSH问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试在宅基地流浪者的帮助下创建一个Laravel应用程序.我正在使用Windows 7开发环境.我正在使用Per Project安装,现在在Laravel文档中,我可以

I am trying to create a Laravel App with the help of homestead vagrant. I am using a Windows 7 development environment. I'm using the Per Project Installation and I'm at the point in the Laravel Documentation that I can vagrant up my project. When I do vagrant up in my project I get hung up on

SSH身份验证方法:密码

SSH auth method: password

,我收到以下消息:

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.

我正在使用Laravel 5.3和Vagrant 1.9.0.我使用的是Vagrant 1.8.4,但是一旦出现问题,我就安装了Vagrant 1.9.0,但收到的是完全相同的错误.我尝试从此处,然后从vb.gui中,可以从启动的服务器中看到以下错误:

I am using Laravel 5.3 and Vagrant 1.9.0. I was using Vagrant 1.8.4, but once I started having trouble I installed Vagrant 1.9.0, but received the exact same error. I tried te following fix from here, and from the vb.gui I could see the following error from the launched server:

[   0.100000] Failed to access perfctr msr (MSR c0010007 is 0)
  lvmetad is not active yet, using direct activation during sysinit
  lvmetad is not active yet, using direct activation during sysinit
Scanning for Btrfs filesystems
/dev/mapper/vagrant--vg-root:clean, 127066/2559088 files, 1241443/10228736 blocks
[  10.420196] piix4_smbus 0000:00:07.0: SMBus base address uninitialized - updrade BIOS or use force_addr=0xadr
[    ] A start jon is running for Raise network interfaces (4 min 44s / 5min 5 s)

然后服务器启动,我可以登录,但是服务器上未设置我的Homestead.yaml文件中的文件夹和IP.

and then the server start and I can log in, but my folders and IP from my Homestead.yaml file are not set on the server.

这是我的Homestead.yaml文件:

This is my Homestead.yaml file:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: mysite
name: mysite
provider: virtualbox

authorize: C:/Users/xxx/.ssh/id_rsa.pub

keys:
    - C:/Users/xxx/.ssh/id_rsa

folders:
    - map: "C:/Users/xxx/www/mysite"
      to: "/home/vagrant/mysite"

sites:
    - map: homestead.app
      to: "/home/vagrant/mysite/public"

databases:
    - homestead

实例正在运行,而我正在运行:

While the instance is running and I run:

vagrant ssh-config

我知道

Host mysite
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentitiesOnly yes
LogLevel FATAL
ForwardAgent yes

当我跑步时:

vagrant global-status

我得到:

id       name   provider   state   directory
-----------------------------------------------------------------------
66eb5bf  mysite virtualbox running C:/Users/xxx/www/mysite

当我尝试通过使用以下方法从无业游民那里获得degub信息时:

When I try and get the degub info from vagrant by using this:

vagrant up --debug > vdebug.txt

在命令提示符下生成大量消息,但在vdebug.txt文件中仅生成以下消息:

generates a lot of messages in the command prompt but only this in the vdebug.txt file:

Bringing machine 'mysite' up with 'virtualbox' provider...
==> mysite: Importing base box 'laravel/homestead'...

[KProgress: 20%
[KProgress: 30%
[KProgress: 60%
[KProgress: 70%
[KProgress: 90%
[K==> mysite: Matching MAC address for NAT networking...
==> mysite: Checking if box 'laravel/homestead' is up to date...
==> mysite: Setting the name of the VM: mysite
==> mysite: Clearing any previously set network interfaces...
==> mysite: Preparing network interfaces based on configuration...
    mysite: Adapter 1: nat
    mysite: Adapter 2: hostonly
==> mysite: Forwarding ports...
    mysite: 80 (guest) => 8000 (host) (adapter 1)
    mysite: 443 (guest) => 44300 (host) (adapter 1)
    mysite: 3306 (guest) => 33060 (host) (adapter 1)
    mysite: 5432 (guest) => 54320 (host) (adapter 1)
    mysite: 22 (guest) => 2222 (host) (adapter 1)
==> mysite: Running 'pre-boot' VM customizations...
==> mysite: Booting VM...
==> mysite: Waiting for machine to boot. This may take a few minutes...
    mysite: SSH address: 127.0.0.1:2222
    mysite: SSH username: vagrant
    mysite: SSH auth method: password

如果您到这篇文章的结尾,谢谢!我的问题是如何将我的IP和文件夹从Homestead.yaml文件获取到服务器.任何帮助将不胜感激.还请告诉我是否可以添加更多信息.我将向您更新我的状态.

If you made it to the end of this post thank you! My questions is how do I get my IP and Folders from my Homestead.yaml file to the server. Any help would be greatly appreciated. Also Let me know if I can add any more info. I will keep you updated on my status.

编辑1

我忘了补充说,我已经启用了虚拟化.

I forgot to add that I enabled virtualization already.

编辑2

我将项目文件夹中的Homestead.yaml文件更改为IP设置为192.168.10.20而不是192.168.10.10,并且仍然没有更改.我将不断更新,直到得到答案为止.

I changed the Homestead.yaml file in my projects folder to have the IP set to 192.168.10.20 instead of 192.168.10.10 and still no changes. I will keep updating till I have an answer.

编辑3

试图更改位于我的项目文件夹中的Vagrant文​​件,以在Vagrant.configure函数中添加以下内容:

Tried to change the Vagrantfile located in my project folder to add the following in the Vagrant.configure function:

config.vm.network "public_network", ip: "192.168.10.20", :bridge => "en1: Realtek PCIe GBE Family Controller #2"

我收到了同样的错误,但是我也收到了这个错误:

I received the same error, but I also received this:

Specific bridge 'en1: Realtek PCIe GBE Family Controller #2' not found. You may be asked to specify
which network to bridge to.

推荐答案

发生此错误是因为Ubuntu尝试提升所有网络接口,但您的电缆未连接,然后等待直到超时.

This error occurs because the Ubuntu tries to raise all your network interfaces, but your cable isn't connected, then it waits until this timeout.

当您导出VM时,似乎出现此问题,有关更多信息,请参见 https://www.virtualbox.org/ticket/15705

It seems that this problem occurs when you export a VM, more info on https://www.virtualbox.org/ticket/15705

您可以编辑您的Vagrant文​​件,并将这些行添加到Vagrant.configure循环的末尾:

You can edit your Vagrantfile and add these lines in the end of Vagrant.configure loop:

 config.vm.provider "virtualbox" do |vb|
        vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
    end

基本上在最后一个结束"之前添加此内容.

Basically add this right before the very last "end".

这篇关于Laravel流浪了SSH问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆