我已经在我的 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
但是当我在浏览器中输入“ 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
似乎没有防火墙问题,因为如果我输入
vagrant@lucid32:~$ curl 'http://google.com'
它工作正常。
我已阅读Vagrant 的端口转发不起作用 并尝试过:
vagrant@lucid32:~$ curl 'http://localhost:80'
curl: (7) couldn't connect to host
并且
vagrant@lucid32:~$ curl 'http://localhost:8080'
curl: (7) couldn't connect to host
所以,看起来端口转发不起作用......
如果你知道我能做什么,我可以从主机浏览器访问我的 vbox,你能帮我吗?
提前致谢