2017-07-25 47 views
0

我通過命令「vagrant up」運行我的虛擬機,沒關係。 「流浪漢SSH」工作好,使用ifconfig的輸出是:Homestead不工作

[email protected]:~$ ifconfig 
     eth0  Link encap:Ethernet HWaddr 08:00:27:12:96:98 
       inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0 
       inet6 addr: fe80::a00:27ff:fe12:9698/64 Scope:Link 
       UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
       RX packets:583 errors:0 dropped:0 overruns:0 frame:0 
       TX packets:420 errors:0 dropped:0 overruns:0 carrier:0 
       collisions:0 txqueuelen:1000 
       RX bytes:65606 (65.6 KB) TX bytes:56229 (56.2 KB) 

     lo  Link encap:Local Loopback 
       inet addr:127.0.0.1 Mask:255.0.0.0 
       inet6 addr: ::1/128 Scope:Host 
       UP LOOPBACK RUNNING MTU:16436 Metric:1 
       RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
       TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
       collisions:0 txqueuelen:0 
       RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) 

我Homestead.yaml是:

ip: 192.168.10.10 
memory: 2048 
cpus: 1 
provider: virtualbox 
authorize: C:/Users/franc/.ssh/id_rsa.pub 
keys: 
    - C:/Users/franc/.ssh/id_rsa 
folders: 
    - 
     map: C:/Users/franc/Websites/Prova 
     to: /home/vagrant/Code/prova 
sites: 
    - 
     map: Prova.app 
     to: /home/vagrant/Code/prova/public 
databases: 
    - homestead 
name: prova 
hostname: prova 

但是當我嘗試瀏覽我的web應用這是行不通的。 我試過http://prova.app,192.168.10.10:8000,127.0.0.1:8000,http://localhost:8000但它仍然不起作用。

那我的Hosts文件:

# Copyright (c) 1993-2009 Microsoft Corp. 
# 
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows. 
# 
# This file contains the mappings of IP addresses to host names. Each 
# entry should be kept on an individual line. The IP address should 
# be placed in the first column followed by the corresponding host name. 
# The IP address and the host name should be separated by at least one 
# space. 
# 
# Additionally, comments (such as these) may be inserted on individual 
# lines or following the machine name denoted by a '#' symbol. 
# 
# For example: 
# 
#  102.54.94.97  rhino.acme.com   # source server 
#  38.25.63.10  x.acme.com    # x client host 

# localhost name resolution is handled within DNS itself. 
# 127.0.0.1  localhost 
# ::1    localhost 

192.168.10.10 prova.app 

更新: 我重新安裝的VirtualBox(最新版本),生成的puttygen保存公衆id_rsa.pub和私營爲id_rsa(不含擴展名)一個SSH密鑰並放入.ssh文件夾中。 克隆的家園倉庫和添加家園框。 配置好Homestad.yaml並在最後開始添加一個項目後「vagrant up」,現在一切正常。

+0

什麼不正確? – rene

+1

添加真相嗎?!我也添加了它...... – Bas

+0

如果你不把它添加到你的主機文件,你的計算機將向DNS請求http://prova.app,這將失敗,因爲這個域名不存在於「全球」互聯網上。 –

回答

0

你能ping你的流浪盒子IP嗎,還是收到0包失敗?

這聽起來很像bug in VirtualBox 5.1.24。該票被標記爲Linux主機,但它也可能影響Windows。

該問題似乎是由於VirtualBox無法爲主機專用網絡創建路由引起的。將VirtualBox回滾到5.1.22可以解決我的問題(在Linux上)。如果您還回滾並修復了問題,我建議您在bug跟蹤器上留言讓他們知道。祝你好運!

+0

我失去了希望,我試了一切 我試圖ping 192.168.10.10,但我得到4包沒有到達 我想我會嘗試重新安裝使用vmware的一切 @DaveLak – FranCode

+0

你有沒有它工作在過去嗎?最近? – DaveLak

+0

不,我從來沒有在 – FranCode