微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Puphpet / Vagrant:无法访问IP地址的LAMP VM

我使用PuPHPet.com来部署本地的Ubuntu 16.04 LAMP开发机器与VirtualBox 5.1.24。 我用VM IP地址(192.168.56.101)更新了/ etc / hosts。

$ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 flippy 192.168.56.101 dev.mysite.com # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters

我可以SSH进入虚拟机,但我不能通过IP地址(192.168.56.101)访问它,也不能访问域名。

Ping失败:

$ ping 192.168.56.101 PING 192.168.56.101 (192.168.56.101) 56(84) bytes of data. ^C --- 192.168.56.101 ping statistics --- 164 packets transmitted,0 received,100% packet loss,time 166895ms

curl失败:

FFmpeg直播stream错误:ffmpeg av_interleaved_write_frame断开的pipe道。 转换失败

如何使用emacs访问Windows共享文件

为什么涓stream实用程序不会影响我的dynamic链接的golang程序?

指定了无效的无效选项

在Vagrant中使用XDEBUG

$ curl -v 192.168.56.101 * Rebuilt URL to: 192.168.56.101/ * Trying 192.168.56.101... * connect to 192.168.56.101 port 80 Failed: Connection timed out * Failed to connect to 192.168.56.101 port 80: Connection timed out * Closing connection 0 curl: (7) Failed to connect to 192.168.56.101 port 80: Connection timed out

此外,主机上的netstat -rn不显示虚拟机IP地址的路由:

$ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlp1s0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlp1s0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp1s0

我还能检查什么?

在vagrant和virtualBox中安装符号链接文件

Windows从睡眠中返回后发生InstanceOwnerException

我可以使用malloc和隐式转换replace对open_memstream的调用吗?

Nginx自签名证书在Vagrant虚拟机上不起作用

如何使用Linux Mint Box上的laravel hometead中的apt-get?

在这里提供了一个答案 ,我相信是相关的,但是我会在这里发布它以及任何其他奇迹进入这个线程寻找一个解决方案。

这听起来很像VirtualBox 5.1.24中的一个bug,它在5.1.26中修复。

这个问题似乎是VirtualBox无法为主机专用的网络创建一个路由导致的。 要检查是否是这种情况,在主机上运行vagrant up ,从终端运行netstat -rn 。 这会在内核的IP路由表中显示可用的路由。 将有几行输出,但其中你应该看到你的私人网络IP看起来像这样:

Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.56.101 0.0.0.0 255.255.255.0 U 0 0 0 vBoxnet3

如果你没有看到为这个IP设置的路由,那么你很可能已经被这个bug所困扰了。 升级到VirtualBox 5.1.26解决了我的问题(在Linux上)。但是puPHPet.com在主页上说:

官方推荐的VirtualBox版本是5.0.26!

所以你可能想要回滚到那个版本

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐