小编nod*_*ubt的帖子

主机中的浏览器无法看到流浪盒,端口无法正常工作

我在我的Window XP中安装了Vagrant,在我的Vagrantfile中我有:

Vagrant::Config.run do |config|
  # Setup the box
  config.vm.box = "lucid32"
  config.vm.forward_port 80, 8080
  config.vm.network :hostonly, "192.168.10.200"
end
Run Code Online (Sandbox Code Playgroud)

但是当我在浏览器中输入" http://192.168.10.200:8080 " 时,我看不到我的流浪盒的迹象.

虚拟盒的IP地址是正确的,因为在vbox中,我有:

vagrant@lucid32:~$ ifconfig
....
eth1      Link encap:Ethernet  HWaddr 08:00:27:79:c5:4b
          inet addr:192.168.10.200  Bcast:192.168.10.255  Mask:255.255.255.0
Run Code Online (Sandbox Code Playgroud)

似乎没有防火墙问题,因为如果我键入

vagrant@lucid32:~$ curl 'http://google.com'
Run Code Online (Sandbox Code Playgroud)

它工作正常.

我已阅读Vagrant的端口转发无法正常工作 并尝试:

vagrant@lucid32:~$ curl 'http://localhost:80'
curl: (7) couldn't connect to host
Run Code Online (Sandbox Code Playgroud)

并且

vagrant@lucid32:~$ curl 'http://localhost:8080'
curl: (7) couldn't connect to host
Run Code Online (Sandbox Code Playgroud)

所以,看起来像港口前进不起作用......

如果你知道我能做什么,我可以从主机浏览器访问我的vbox,你能帮帮我吗?

提前致谢

http portforwarding vagrant

2
推荐指数
1
解决办法
7668
查看次数

标签 统计

http ×1

portforwarding ×1

vagrant ×1