Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davorminchorov's avatar

Laravel Homestead and Connection Refused. Retrying........

Hey there!

I had Laravel Homestead setup on v. 1.* but now I want to move to v2 so I deleted all the boxes and installed Homestead via composer. I had some problems on the way of installing the box but I fixed it.

But now I have a new problem. When I run:

homestead up

I see the VM booting up and gets stuck at the point where it's supposed to log in automatically.

For some reason, I get the message:

default: Warning: Connection refused. Retrying...

until the timeout timer is reached.

I believe it has something to do with insecure private keys (I did get a few insecure private key messages), but I am not sure how to fix that. I never had this problem before with v1.*

I can log in myself through the VBox GUI but the folder mapping is not done yet so the VM is empty.

Anyone here knows how to fix or had any experience with this?

0 likes
23 replies
davorminchorov's avatar

When I run:

homestead provision

I get:

Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
davorminchorov's avatar

Nope, I can't do it through a console. When I try to do:

homestead ssh

using Git Bash, it doesn't return any message so it looks like nothing happens but when I run the same command using Cygwin, I get the following error:

Could not open input file: /cygdrive/c/Users/Username/appData/roaming/composer/vendor/laravel/homestead/homestead
mehany's avatar

@Ruffles There seem to be something odd, not sure what though. I use OSX, so I hope these few things will help troubleshoot and maybe we learn something new
1- open VM manager
2- run vagrant global-status and rap the machine ID.
3- Destroy it vagrant destroy machineID
4- do homestead edit and make sure everything looks ok as per docs.
5- homestead up
6- Finally, and hopefully, homestead ssh

1 like
davorminchorov's avatar

@mehany Interesting! I just noticed that there's an extra VM running in background in a non-existing path. (I used to have a folder new and inside it I had Homestead, v1.* but later on, I deleted it)

Anyway, your suggestion didn't work. The search for the solution continues!

davorminchorov's avatar

I'll try to clean up any config files and reinstall both Vagrant (1.7.3) and Virtual Box (5.0.0)

davorminchorov's avatar

No luck with the reinstall, I still get the same problem. It has something to do with some settings but I have no idea where to start looking.

jeffer8a's avatar

i'm having the same problem, if you are using windows make sure you have vt virtualization on (you do this in the BIOS config).

apparently some cpu's don't allow this. like mine, but i'm using ubuntu so, i really don't know how to solve this. :(

vitorarjol's avatar

Today my machine (on Windows host) suddenly stops working. Just followed the steps provided by @mehany and everything works again! Thanks!

davorminchorov's avatar

I forgot to mention that I have a strange renaming issue when I am trying to run Homestead up for the first time. The error says:

VirtualBox error:

VBoxManage.exe: error: Could not rename the directory 'D:\Oracle VirtualBox VMs\settler_default_1434987271004_24349_1437685693707_20721' to 'D:\Oracle VirtualBox VMs\homestead' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "SaveSettings()" at line 3015 of file VBoxManageModifyVM.cpp

Oh yeah, that does not have anything to do with the logging in issue and connection timeout, retrying.

davorminchorov's avatar

I downloaded that Homestead32 thing and it didn't work, I have the same problem. I really have no idea! Gonna wait for Windows 10 to come out so I can start fresh! Until then, if someone knows a solution, please let me know!

vitorarjol's avatar

@Ruffles I use homestead via composer as well, let me try to help you with my configs.

First, install the homestead.

composer global require "laravel/homestead=~2.0"
#Then
homestead init
#Then
homestead edit

#This is my config file:
ip: "192.168.10.10"
memory: 1024
cpus: 1
provider: virtualbox

authorize: C:\Users\Username\.ssh\id_rsa.pub

keys:
    - C:\Users\Username\.ssh\id_rsa

folders:
    - map: D:\code
      to: /home/vagrant/code

sites:
    - map: site.dev
      to: /home/vagrant/code/site/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local
#end config file

I use the same setup on my personal computer and work computer (I saw that you use git bash, I use Cmder). Hope it helps!

davorminchorov's avatar

@vitorarjol thanks for sharing your homestead.yaml file but I believe my problem has more to with VirtualBox. It used to work but after changing versions, it stopped.

Anyway, I was looking at the VBoxSVC.log file and I noticed that there's an error written all over the file:

00:00:00.456081          ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={480cf695-2d8d-4256-9c7c-cce4184fa048} aComponent={SessionMachine} aText={No storage device attached to device slot 1 on port 0 of controller 'IDE Controller'}, preserve=false
vitorarjol's avatar

And what the version of your virtualbox? I'm using the v 4.3.28.

davorminchorov's avatar

I've tried with 4.3.30 and 5.0.0! I'll try with older versions and see how it goes.

1 like
davorminchorov's avatar

The version of virtualbox is irrelevant to this problem it seems. v4.3.28 didn't change anything. I have no idea where to look for the problem.

davorminchorov's avatar

It looks like this part is supposed to come up after connecting but it's not getting there at all.

default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...

Something is wrong with the ssh keys.

davorminchorov's avatar

Ok I ran homestead up --provision and it fixed the problem, I am finally in my VM! Wooohooooo! Thanks for the help!

Do you by any chance know how to fix the colors and the extra jibberish that shows up when I do ls?

Update: I installed my 10th console application ConEmu and now everything is fine. Cmder didn't work as expected when trying to open a tab using Git Bash.

1 like
lyesqiz's avatar

@Ruffles i'm having the same problem, if you are using windows make sure you have vt virtualization on

georgekelly's avatar

For anyone experiencing this issue today, more than likely your forwarded port defined in your Homestead.yaml is in use on your host machine. During vagrant up, take a look at the "Forwarding ports..." section in your console and you'll be able to see which port it's using on your host machine instead. Just use the host port in your DB connection config. Ideally though you'd find out why the port is in use / use a different port.

==> organise: Forwarding ports...
    organise: 80 (guest) => 2200 (host) (adapter 1)
    organise: 443 (guest) => 2201 (host) (adapter 1)
    organise: 3306 (guest) => 33060 (host) (adapter 1)
    organise: 4040 (guest) => 4040 (host) (adapter 1)
    organise: 8025 (guest) => 8025 (host) (adapter 1)
    organise: 9600 (guest) => 9600 (host) (adapter 1)
    organise: 27017 (guest) => 27017 (host) (adapter 1)
    organise: 5432 (guest) => 2202 (host) (adapter 1)
    organise: 22 (guest) => 2203 (host) (adapter 1)

Please or to participate in this conversation.