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

_recurse's avatar

Can't connect to Homestead (ping 192.168.10.10 fails)

I assume this is less of a homestead and more of a vagrant issue in general, still - maybe someone will be able to help.

I have a homestead box which suddenly stopped responding. I can do "vagrant ssh" and get into it, but I can't access my projects from the host machine (e.g. in the browser).

  1. From my host machine (OSX), ping 192.168.10.10 times out
  2. From within the homestead box (vagrant ssh works), ping 192.168.10.10 works and gets back to itself
  3. On the homestead box, ifconfig returns 192.168.10.10 for eth1
  4. On the host machine, arp -a doesn't list the box, but I'm not sure it would do that anyway
  5. I have not modified my homestead.yaml apart from adding one project
  6. It used to work normally a couple of days ago

I already tried:

  1. Re-starting the box
  2. Re-provisioning the box
  3. Destroying and re-creating the box

All of the above worked without any unusual errors, but didn't fix the problem.

0 likes
24 replies
latz's avatar

Take a look for the network of virtualbox. What says ifconfig at the host machine?

_recurse's avatar

Sure - here's what it says for vboxnet0 (I ran ifconfig on the host machine):

vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:00 
    inet 192.168.10.1 netmask 0xffffff00 broadcast 192.168.10.255

Thanks!

_recurse's avatar

I now know what the problem is. Somehow, the box listens to 127.0.0.1:8000from the host machine instead of 192.168.10.10:80.

So I can test my projects now, with the hassle of having to append :8000 to the URLs. That's weird, the homestead.yaml specifically says to be available at 192.168.10.10 ...

latz's avatar

This is a little trick, but not the solution. Try ping to 192.168.10.1. Perhaps there is a mismatch with the network options in virtualbox?

_recurse's avatar

I tried pinging 192.168.10.1, but still no luck. It times out as well.

Even tried matching the IP in the Homestead.yaml to 192.168.10.1 and reprovisioning+rebooting the box, but that didn't help either.

How can I find out if there's a mismatch within the network options? I just checked the virtualbox GUI, but it doesn't provide too much information under the network settings...

Fuxy22's avatar
Fuxy22
Best Answer
Level 12

Have you tried restarting the host machine? if the host updated the kernel it could cause virtualbox to fail in wierd ways. A restart should re load all kernel modules including the virtualbox one and that could fix it.

3 likes
_recurse's avatar

Well, so that was exactly it. Somehow it didn't come to my mind to reboot the host as well. Thanks to both of you!

elewandowska's avatar

What I found out is that you need to edit the Vagrantfile in the homeasted directory on line 29 to create private network. This allowed me to ping the 192.168.10.10 IP successfully and connect to database from HeidiSql.

Create a private network, which allows host-only access to the machine using a specific IP.

config.vm.network "private_network", ip: "192.168.10.10"

Hope this help some people.

1 like
hendra's avatar

Sorry for necro-ing an old thread, but I also often ran into this issue, and as suggested by one of the reply, rebooting the machine fixes the issue.

Though I'm not sure what is the exact root cause, in my case it happens often enough that rebooting the machine isn't really an option (it seems to happen when I connect to some of my VPN).

So if anyone is also running into similar issue, rebooting the vbox network interface seems to also achieve the same thing without rebooting.

sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet up on macos. You can see the interface the vm is using on the Virtualbox app.

1 like
matt.libera's avatar

@HENDRA - This works beautifully. I was searching for a way to accomplish this without having to restart my host machine. I was able to verify vboxnet0 in the Virtualbox GUI, and made one tweak to your suggestion:

sudo ifconfig vboxnet0 down && sudo ifconfig vboxnet0 up worked for me - making sure the interface name is the same in both directives. (Otherwise it would fail on my machine.) For those looking for where to find this info, in Virtualbox GUI, go to Machine Tools > Details to ensure details are being shown, and then look in the Network pane - for me it was Adapter 2 (Host Only Adapter, 'vboxnet0')

Just wanted to give you some kudos for providing this workaround that doesn't require the entire host machine to be rebooted!

journeelabs's avatar

In case anyone runs into this in 2021... It took me 4 hours to figure out the latest version of Virtualbox (v6.1.28) only supports IP Address in 192.68.56.0/21 range to be assigned to host-only adapters. Changing the IP in the Homestead.yaml file to "192.168.56.10" fixed the issue for me. Make sure your running as sudo user ie "sudo vagrant up". First post so I can't include a link

"On Linux, Mac OS X and Solaris Oracle VM VirtualBox will only allow IP addresses in 192.68.56.0/21 range to be assigned to host-only adapters. For IPv6 only link-local addresses are allowed. If other ranges are desired, they can be enabled by creating /etc/vbox/networks.conf and specifying allowed ranges there. For example, to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as 2001::/64 range put the following lines into /etc/vbox/networks.conf:"

16 likes
wyfi's avatar

@journeelabs Saved me a ton of time, after already having spent a couple hours, trying to figure out why my shared folders would no longer mount. Thanks!

Diebeck's avatar

@journeelabs Just created an account (Was a reader for quite long already) to say THANK YOU! You saved me hours of research.

Firemaps's avatar

Same problem here. Found out after hours of searching that changing the IP to 192.168.56.4 in Homestead.yaml and /etc/hosts file fixed it for me

2 likes
vlab22's avatar

Here, when connected to a VPN using a Windows 11 built-in solution, I couldn't ping/access the 192.168.10.10. After DISCONNECTING from VPN, the virtual machine was accessible.

Please or to participate in this conversation.