browser in host can not see vagrant box (window xp)

1,619 views
Skip to first unread message

Apollo Tang

unread,
May 21, 2012, 2:49:37 PM5/21/12
to vagra...@googlegroups.com
I have follow the instruction in


and installed Vagrant in my Window XP
In my Vagrantfile I have:

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

But I see no sign of my vagrant box when I type "http://192.168.10.200:8080" in browser.

IP address of the virtual box is correct, because from within the vbox, I have:

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

There seem to be no firewall problem because I installed curl and type:

vagrant@lucid32:~$ curl 'http://google.com'

it works fine.

I can ping 192.168.10.200 from window xp (host) and from within vagrant box.

I get the feeling my browser in window xp (host) get to 192.168.10.200 alright, but it can't see index.html in my "public_folder"  (D:\P_1\vagant_guide\index.html)

is my public_folder the folder where I issue the command "vagrant init" (ie "D:\P_1\vagant_guide\") ?

I am running out of idea solving this. If you know what I can do so I can access my vbox from host browser, can you help me?

Thanks in advance

John D. Hume

unread,
May 22, 2012, 8:02:04 AM5/22/12
to vagra...@googlegroups.com

If you ssh into the vagrant box and `curl localhost:8080` do you see your index.html?

-- typed with my thumbs

Apollo Tang

unread,
May 22, 2012, 2:59:16 PM5/22/12
to Vagrant
Hi John, Thanks for replying

I have tried that, but it didn't work (see below) :(
any idea? so far everything is great, except my browser can't see my
vagrant box...


--------- begin console capture
vagrant@lucid32:~$ curl localhost:8080
curl: (7) couldn't connect to host
vagrant@lucid32:~$ curl localhost:80
curl: (7) couldn't connect to host
vagrant@lucid32:~$ curl 127.0.0.1
curl: (7) couldn't connect to host
vagrant@lucid32:~$ curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/
html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
vagrant@lucid32:~$ curl 127.0.0.1:8080
curl: (7) couldn't connect to host
vagrant@lucid32:~$ curl 127.0.0.1:80
curl: (7) couldn't connect to host
vagrant@lucid32:~$ ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.099 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.036 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.037 ms
64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.038 ms
64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.055 ms
64 bytes from 127.0.0.1: icmp_seq=7 ttl=64 time=0.029 ms
64 bytes from 127.0.0.1: icmp_seq=8 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: icmp_seq=9 ttl=64 time=0.061 ms
64 bytes from 127.0.0.1: icmp_seq=10 ttl=64 time=0.039 ms
64 bytes from 127.0.0.1: icmp_seq=11 ttl=64 time=0.060 ms
64 bytes from 127.0.0.1: icmp_seq=12 ttl=64 time=0.056 ms
^Z
[1]+ Stopped ping 127.0.0.1
----------end console capture


On May 22, 8:02 am, "John D. Hume" <duelin.mark...@gmail.com> wrote:
> If you ssh into the vagrant box and `curl localhost:8080` do you see your
> index.html?
>
> -- typed with my thumbs

Elmer Rivera

unread,
May 21, 2012, 11:42:47 PM5/21/12
to vagra...@googlegroups.com
Hi,

The base boxes does not include a default web server thus you don't
see a web page. If you continue with the guide, there is a Provision
guide which helps you to setup a sample apache server.

If you like, you can ssh to your vm and install the apache package,
you then setup your DocumentRoot to point to your /vagrant directory.

hth,
--
Elmer

Apollo Tang

unread,
May 23, 2012, 1:06:02 AM5/23/12
to Vagrant
That explained everything Elmer!
of course, without apache, there is nothing to serve my browser!

Thank you so much, I will continue with the guide :)


.......
On May 21, 11:42 pm, Elmer Rivera <elmer.riv...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages