Vagrant stuck connection timeout retrying
My vagrant was working perfectly fine last night. I've just turned the PC on, hit vagrant up
, and this is what I get:
==> 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 => 2222 (adapter 1)
==> default: Booting VM...
==> 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 timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
Has anyone had this before? vagrant isn't widely covered on the web yet and I can't find a reason why this is occurring.
I solved this problem, and will answer in case anyone else has a similar issue.
What I did was: I enabled the GUI of Virtual box to see that it was waiting for input on startup to select whether I wanted to boot directly to ubuntu or safemode etc.
To turn on the GUI you have to put this in your vagrant config Vagrantfile
:
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
When you are stuck with your vagrant machine the way described above there is no need to boot in gui mode (and is impossible without an X server).
While your VM is booting, in a separate terminal window, just find out the id of the running machine.
vboxmanage list runningvms
This will result in something like this:
"projects_1234567890" {5cxxxx-cxxx-4xxx-8xxx-5xxxxxxxxxx}
Quite often, the VM is simply waiting for you to select an option in the bootloader. You can send the appropriate keycode (in the case, Enter) to the vm with controlvm
:
vboxmanage controlvm projects_1234567890 keyboardputscancode 1c
That's it. Your virtual machine will continue the boot process.
One thing to double check is if Hardware Virtualisation is enabled in your machine's BIOS.
My problem is the same string of timeouts but I could only see a black screen in the GUI.
A laptop which I was just setting up kept showing the same problem. After hours of searching I finally found a tip to see if the BIOS had Hardware Virtualisation was enabled.
Here's the content of the post I found:
I see there are still some users who are experiencing this issue. So, I will attempt to summarise a list below of some possible solutions to the SSH timeout problem:
Hope that helps.
链接地址: http://www.djcxy.com/p/30124.html上一篇: 虚拟化环境
下一篇: 流浪者卡住连接超时重试