I’m getting an SSH timeout error running vagrant up
Here’s the output :
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-20.04' version '202112.19.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 172.24.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
I have installed the virtualbox_WSL2 plugin as recommended on other posts but I keep having the same timeout issue.
I don’t know if this is relevant but I have the Hyper-V checkbox disabled on Windows Features while Windows Hypervisor Platform is enabled.
(Please replace the mounting home path to your dev folder)
PS:
After trellis run completely please look into /etc/hosts in Ubuntu about your vm’s IP, with those entries you’re able to update the Windows host file as well.
I added your line to my .bashrc, reloaded it and ran trellis but the /etc/hosts file does not contain any reference to the VM to which I’m trying to connect. This being said there are references to old VMs, they’re all using the same IP, so should I add manually my VM to the hosts?
I tried reprovisiong and ran into this error message
vagrant provision
==> default: Running provisioner: ansible_local...
An error occurred in the underlying SSH library that Vagrant uses.
The error message is shown below. In many cases, errors from this
library are caused by ssh-agent issues. Try disabling your SSH
agent or removing some keys and try again.
If the problem persists, please report a bug to the net-ssh project.
Net::SSH::ConnectionTimeout
My SSH problem was caused by Windows Defender firewall blocking connections to the protected network. I was able to solve the issue by removing vEthernet (WSL) for each of the Domain, Private, and Public profiles as described here : https://github.com/microsoft/WSL/issues/4139#issuecomment-732665787.
Now I’m having a missing mysql extension error but this is another story.