小编Kat*_*tie的帖子

无法从vagrant VM发出出站HTTP请求

我无法从我设置的Vagrant虚拟机中连接到Internet.

例如,在root用户输入时:

curl http://google.com
Run Code Online (Sandbox Code Playgroud)

它失败并显示以下消息:

curl: (6) Couldn't resolve host 'google.com'
Run Code Online (Sandbox Code Playgroud)

我不确定它是否是防火墙设置,但据我所知,我没有为端口80或任何其他端口创建任何防火墙规则.

这是我的Vagrantfile的相关部分.如果我能提供任何其他信息,请在评论中告诉我:

Vagrant.configure("2") do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,
  # please see the online documentation at vagrantup.com.


  # Let Vagrant manage the hostname at boot
  config.vm.hostname = "devbox"

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host …
Run Code Online (Sandbox Code Playgroud)

php linux vagrant vagrantfile

10
推荐指数
1
解决办法
5064
查看次数

标签 统计

linux ×1

php ×1

vagrant ×1

vagrantfile ×1