Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Connection refused. Retrying in Laravel Homestead installation

Hi there,

I've followed the video in treehouse and documentation in http://laravel.com/docs/homestead for setting up homestead. However, no matter how hard I tried, I always got " default: Error: Connection timeout. Retrying..." error, meaning I can't ssh into server.

I'm pretty use I've done following correct after some research:

  • latest version for vagrant and virtual box
  • id_rsa_pub and id_rsa setting
  • trying to tell vagrant boot in GUI mode
  • networking setting, which is 1 for NAT and 2 for local hostly
  • reinstall box in vagrant

I've tried all of possible solutions above, none of these seems to work for me :(

However, I've noticed the insecure_private_key in ~/.vagrant.d is different from ~/.ssh/id_rsa, Does this matter ?

BTW, I'm using OSX 10.9 with LAMP installed.

I'm experiencing a similar error on my Windows 8 machine with Vagrant 1.6.3. I've tried a bunch of fixes without any luck. Hampton Paulk , do you have any idea what a possible solution could be?

Howdy alexchiang - At what point are you getting this error. Just a shot in the dark, before I know more, do you have an apache instance (LAMP) running currently? If so, when you try to connect to 127.0.0.1, it may be finding your running server and not the Vagrant instance.

Let me know, so I can try to reproduce the problem. Same for you Jason Jones

Thank you for responding so quickly. I just submitted a new discussion question here with the specifics to my issue.

Hi Hampton Paulk

I got this error when I was trying to use vagrant up to boot the VM. No, my LAMP is completely off at that time.

Strange thing is, when I was trying to boot in GUI mode, i can login into VM in GUI interface, however I can't find folder named Sites which specified in the yaml file. Also, vagrant ssh and ssh vagrant@127.0.0.1 -p 2222 both failed. That means the communication between vagrant and VM was not succeed, it didn't process that yaml file somehow.

I've checked the following to eliminate possible errors:

  • ssh key settings and vagrant ssh-config key match and configured correctly
  • networking settings 1 for NAT 2 for local host
  • BIOS VT-x settings enabled
  • boot VM in GUI
  • latest version of vagrant and vm checked
  • force vm to boot in 64-bit
  • change private ip to "10.0.10.10" both in yaml and homestead.rb

For now, I can only use php artisan serve to play with, It won't be an issue until I need to connect to database...

Update

After I applied the answer provided by this thread, the problem still persists.

2 Answers

Good Morning alexchiang

Thank you for providing all your feedback.

This may be an edge case, so would you mind posting your homestead.yaml for me? You can copy and paste it into a gist at gist.github.com and then post the link here.

Sorry about the issues, but I am sure we can get you sorted out!

Cheers, Hampton

Hi Hampton Paulk,

Thanks for following up this annoying problem :-)

I've put my homestead.yaml, VagrantFile, homestead.rb in this gist.

Yeah, I think my one is a super edge case, I've switched from OSX to Windows, and do the whole process again, guess what, the virtual box failed to open a process. Meaning the VM can't even get booted. All the patches mentioned above failed to work, again...

For now, I'm using php artisan to do some local work, and also created a localhost database in sequel pro.

hi alexchiang - not sure if you have had any luck over the weekend.

I am not sure you can use "~/" in your homestead. You should try to change these to "/Users/PigFly/" and see if this helps.

Hi Hampton Paulk,

Thanks for your reply. Using ~/ is fine, I check the vagrant folder, it read and process the PKI successfully. I've gave up on this vagrant + homestead for local development solution. Instead, I use a LAMP + artisan as my laravel local environment :)

Thanks for your great tutorials on laravel, looking forward to Laravel Intermediate if possible :-)

Cheers.