Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant share can't detect HTTP port #3118

Closed
thasmo opened this issue Mar 11, 2014 · 30 comments
Closed

vagrant share can't detect HTTP port #3118

thasmo opened this issue Mar 11, 2014 · 30 comments

Comments

@thasmo
Copy link

thasmo commented Mar 11, 2014

Although I have forwarded port 80 and Apache is running on the VM, vagrant share is not able to detected the port:

vagrant share
==> default: Detecting network information for machine...
    default: Local machine address: 127.0.0.1
    default:
    default: Note: With the local address (127.0.0.1), Vagrant Share can only
    default: share any ports you have forwarded. Assign an IP or addres to your
    default: machine to expose all TCP ports. Consult the documentation
    default: for your provider ('virtualbox') for more information.
    default:
Vagrant was unable to detect an HTTP port for your machine.

Because your machine appears to have no static IP associated with
it, Vagrant scans through your forwarded ports, looking for one
that responds to an HTTP request. Vagrant couldn't find any
functioning HTTP port!

There are a few options to fix this error:

  1. Create a forwarded port pointing to your HTTP server inside
     your Vagrant machine.

  2. Specify an HTTP port manually with `--http-port` to this
     command.

  3. Assign a non-local address to your machine. This may or may
     not be possible depending on what provider you're using.

  4. Make sure that the HTTP server is up and running within
     your machine. Vagrant share won't start until it is
     reachable.

Did I miss something?

@mitchellh
Copy link
Contributor

Can you attach a full debug log?

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Yep, sorry for not doing it in the first place.
https://gist.github.com/thasmo/80755160f3f11686a987

@mitchellh
Copy link
Contributor

Can you visit http://127.0.0.1:80/ and it loads? The plugin is reporting that it couldn't connect to that address. If it is working, then what is it responding with (http 200?)

Usually, below port 1024, you need admin privileges. That might be the issue. Try forwarding HTTP to higher than 1024.

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Request:

GET / HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,de-at;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Cookie: PHPSESSID=tdsbav69n9g3pdtta03fgj5ag4
Connection: keep-alive
Cache-Control: max-age=0

Response:

HTTP/1.1 200 OK
Date: Tue, 11 Mar 2014 16:22:04 GMT
Server: Apache
X-Powered-By: PHP/5.4.9-4ubuntu2.4
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=5, max=95
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

@mitchellh
Copy link
Contributor

Super weird. The vagrant plugin is not getting a 200. Can you try with another port forwarding? Try 8080

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Elevated prompt (run as admin) doesn't work either - going to try another port.

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Using port 1234 seems to work but only if the prompt is elevated too, although I can't use it because I still can't use vagrant login. When booting the box I also get this all the time, but I think it's unrelated:

==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Error: Connection timout. Retrying...
==> default: Machine booted and ready!

@mitchellh
Copy link
Contributor

Yeah that looks fine to me (the last bit).

Yeah the port issue I'm pretty confident is a strange Windows and permissions issue on the firewall. Lets solve your login problem.

@cheesegrits
Copy link

I ran in to this issue. I managed to get it going by running both the prompt (in my case Git bash) and the VirtualBox GUI elevated. And to get the VB GUI running elevated, you have to halt all running VM's before starting it.

With both prompt and VB GUI running elevated, it happily shared ...

...
Hugh@ARTHUR /f/vagrant/joomlatools
$ vagrant share
==> default: Detecting network information for machine...
default: Local machine address: 33.33.33.58
default: Local HTTP port: 80
default: Local HTTPS port: disabled
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
default: Share will be at: xxxx-xxxxxxxx-7797
==> default: Your Vagrant Share is running! Name: xxxx-xxxxxxxx-7797
==> default: URL: http://xxxx-xxxxxxxx-7797.vagrantshare.com
...

-- hugh

@IljaN
Copy link

IljaN commented May 7, 2014

I had to do --http 80 manually even if it states that default http ports are detected automatically.

@kmark
Copy link

kmark commented Jan 26, 2015

@IljaN had to do the same on OS X. There was no need to forward any ports via config.vm.network

@mitchellh Can we have this reopened or should I create a new issue?

@swreeser
Copy link

@mitchellh @kmark I installed Vagrant 1.7.2 on Windows x64 and got the same error message. Has this issue been resolved?

@IljaN Thanks! Specifying the port worked like a charm.

@kmark
Copy link

kmark commented Jan 30, 2015

@swreeser @mitchellh Not that I know of.

@mcallari
Copy link

I am on OSX 10.11.1 and using vagrant 1.7.4

vagrant share --http 80 worked for me as well.

Thanks @IljaN

@steve-rhodes
Copy link

Did a new install of vagrant yesterday and from then on "vagrant share" stopped working with the same errors as original poster.

When I type "vagrant share --http 80" it works. What the hell is causing this? This is bad, because PHPstorm only has "Vagrant share" built in and I have to open the terminal now and cd into the right folder first, which takes some time.

What's really puzzling is: why did it work before? I did a clean install (removed virtualbox + vagrant first).

@mylonasg88
Copy link

Installed new Vagrant box through bash file. Can access it through ip and vhost url.

Running "vagrant share" does not work, vagrant can not find the http port.
Running "vagrant share --http 80" generates a URL. Accessing that url on the browser does not work.

Any ideas why?

    default: Local machine address: 127.0.0.1
    default:  
    default: Note: With the local address (127.0.0.1), Vagrant Share can only
    default: share any ports you have forwarded. Assign an IP or address to your
    default: machine to expose all TCP ports. Consult the documentation
    default: for your provider ('virtualbox') for more information.
    default:  
Vagrant was unable to detect an HTTP port for your machine.

Because your machine appears to have no static IP associated with
it, Vagrant scans through your forwarded ports, looking for one
that responds to an HTTP request. Vagrant couldn't find any
functioning HTTP port!

There are a few options to fix this error:

  1. Create a forwarded port pointing to your HTTP server inside
     your Vagrant machine.

  2. Specify an HTTP port manually with `--http` to this command.

  3. Assign a non-local address to your machine. This may or may
     not be possible depending on what provider you're using.

  4. Make sure that the HTTP server is up and running within
     your machine. Vagrant share won't start until it is
     reachable.
==> default: Detecting network information for machine...
    default: Local machine address: 127.0.0.1
    default:  
    default: Note: With the local address (127.0.0.1), Vagrant Share can only
    default: share any ports you have forwarded. Assign an IP or address to your
    default: machine to expose all TCP ports. Consult the documentation
    default: for your provider ('virtualbox') for more information.
    default:  
    default: Local HTTP port: 80
    default: Local HTTPS port: disabled
    default: Port: 2222
    default: Port: 3306
==> default: Checking authentication and authorization...
==> default: Creating Vagrant Share session...
    default: Share will be at: antsy-musk-7827
==> default: Your Vagrant Share is running! Name: antsy-musk-7827
==> default: URL: http://antsy-musk-7827.vagrantshare.com
==> default:  
==> default: You're sharing your Vagrant machine in "restricted" mode. This
==> default: means that only the ports listed above will be accessible by
==> default: other users (either via the web URL or using `vagrant connect`).```

@steve-rhodes
Copy link

I have the same problem. Since yesterday not even vagrant share --http 80 works.

I have the same messages like you posted above.

When trying to access the vagrant link I get:

The cold-bear-7253.vagrantshare.com page isn’t working

cold-bear-7253.vagrantshare.com is currently unable to handle this request.
HTTP ERROR 500

@adrianmak
Copy link

adrianmak commented Dec 14, 2016

After upgraded vagrant to the latest 1.9.1 (prior was running 1.8.7)
Vargant share didn't work anymore
Even though I could use --http 80 to eliminate the error message, but the web url is not accessible.

@steve-rhodes
Copy link

steve-rhodes commented Dec 14, 2016

In my case I could make it work with:
vagrant share --http 8000

...but I guess that could be more Laravel/Homestead specific (I use its box). Still worth a try...

@adrianmak
Copy link

After I fallback to version 1.8.7
The problem gone.

@steve-rhodes
Copy link

steve-rhodes commented Dec 14, 2016

Went back to 1.8.6 and vagrant share --http 80 worked again.

Then I went back to 1.8.5 and I could even use plain vagrant share (which is built into PHPstorm and great to use!).

The rest of my setup is VirtualBox 5.1 on Win 10.

@adrianmak
Copy link

@elasticsteve

I could use vagrant share (without specific http port 80 ) on 1.8.7

@mylonasg88
Copy link

mylonasg88 commented Dec 16, 2016

I fixed it by adding these lines in the end of Vagrantfile:

Vagrant.configure("2") do |config|
    config.vm.network "forwarded_port", guest: 80, host: 8000, auto_correct: true
end

It could not find where to forward ports. Now it works but very slow.

@Chashkin
Copy link

@mylonasg88 Added but still does not work, it freezes and creates a link is nothing
image

@martinlanglois
Copy link

@mylonasg88 that solution worked for me too, but like you said, it is painfully slow... I mean it won't work after hitting 3 pages...

@martinlanglois
Copy link

@mylonasg88 I reverted to 1.8.7 and it seems to have fixed it .
( using vBox 5.1.10 ) on mac OSX serria

@ghost
Copy link

ghost commented Jan 31, 2017

I'm adding my +1 to this.

1.8.7 worked fine, 1.9.1 no longer works. Reverting back to 1.8.7 and it works again.

I do this:
vagrant share --domain a.b.c.d --name myname --http 80

On 1.9.1, accessing through http://name.a.b.c.d share just hangs indefinitely. As soon as I kill vagrant share, I get error in browser so I know it's getting through to my machine.

Revert back to 1.8.7 and domain http://name.a.b.c.d works perfectly again.

OSX El Capitan.

@ianis58
Copy link

ianis58 commented Feb 14, 2017

Same problem here, but as I'm new to Vagrant and Laravel Homestead, I've never been able to setup a working vagrant share...

@Scooch
Copy link

Scooch commented Feb 21, 2017

Hey , i can get it to create a share URL but i cant access it outside of my laptop. connections timeout

@steve-rhodes
Copy link

steve-rhodes commented Feb 21, 2017

There are tons of problems with Vagrant Share. This really sucks and didn't get solved for a long time now. I'm stuck at version 1.8.6 and it's slow as hell too! Docker might be the future, but then again, I don't know if you can share your environment with the outside like we do in Vagrant. I guess not very easily.

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests