Possible SSH problem (newbie)

1,128 views
Skip to first unread message

Adam Turner

unread,
Feb 17, 2016, 1:11:10 PM2/17/16
to Vagrant
I am new to this so please forgive me if I get any terminology wrong.

I have been trying to set up a virtual machine in Windows 10 using Vagrant and VirtualBox. After initializing, when I run vagrant up I just get the following:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise32' is up to date...
==> default: Setting the name of the VM: VirtualMachineTest_default_1455731233974_75780
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2200
    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.


The VM seems to have started in VirtualBox and is awaiting a login. If I go through VirtualBox, I can then log in and it seems to work. If I try vagrant ssh nothing happens. 

I have tried disabling my firewall and antivirus. I have also tried uninstalling and reinstalling latest and older versions of both VirtualBox and Vagrant. On older versions of Vagrant I get additional messages saying the ssh connection was refused. I have also tried deleting the insecure_private_key file, tried using a different box among many other things that I have found on various websites but to no avail.

When I use vagrant halt I get:

==> default: Attempting graceful shutdown of VM...
    default: Guest communication could not be established! This is usually because
    default: SSH is not running, the authentication information was changed,
    default: or some other networking issue. Vagrant will force halt, if
    default: capable.
==> default: Forcing shutdown of VM...

If I run with info level logging, i get lots of this:

 INFO ssh: Attempting SSH connection...
 INFO ssh: Attempting to connect to SSH...
 INFO ssh:   - Host: 127.0.0.1
 INFO ssh:   - Port: 2200
 INFO ssh:   - Username: vagrant
 INFO ssh:   - Password? false
 INFO ssh:   - Key Path: ["C:/Users/Egg/.vagrant.d/insecure_private_key"]
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO ssh: SSH not ready: #<Vagrant::Errors::NetSSHException: 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>
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...
 INFO subprocess: Starting process: ["C:/Program Files/Oracle/VirtualBox/VBoxManage.exe", "showvminfo", "3d67b2af-df47-4610-9899-e022f39d50b6", "--machinereadable"]
 INFO subprocess: Command not in installer, restoring original environment...

Any help would be appreciated!

Thanks 
 

Alvaro Miranda Aguilera

unread,
Feb 17, 2016, 7:37:35 PM2/17/16
to vagra...@googlegroups.com
Hello,

If you test hashicorp/precise32 and that works, then I would be tempted to say it could be something in the box you are using.

hashicorp/*
centos/*
bento/*
ubuntu/*

Are the ones I know they work since I test them a lot.

Other than that, there is no QA of the boxes in Atlas, so you need to test.

Thanks
Alvaro.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/e7139f57-b0c6-4b15-b2ee-5982b4be7e8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Turner

unread,
Feb 18, 2016, 4:36:10 PM2/18/16
to Vagrant
Thanks for the response. I have just tried ubuntu/trusty64 and have exactly the same problem, the VM starts in VBox but the vagrant up command times out. vagrant ssh seems to do nothing. Any other suggestions?

Alvaro Miranda Aguilera

unread,
Feb 18, 2016, 7:27:23 PM2/18/16
to vagra...@googlegroups.com
Hello

at that stage, it could be the VMS are not starting or crashing.

Troubleshooting task a: open the VirtualBox GUI and try to stop and start the VM manually, and see if you get any error.
TTB: try hashicorp/precise32

The 32 box should run in any OS, .. if the 32 works and 64 doesnt usually means the CPU have virtualization extension disabled, need to be enbled on BIOS, or doesn't have the capability to run 64 bits guest.

Please test and let me know how it goes.

Thanks
Alvaro.

On Fri, Feb 19, 2016 at 10:36 AM, 'Adam Turner' via Vagrant <vagra...@googlegroups.com> wrote:
Thanks for the response. I have just tried ubuntu/trusty64 and have exactly the same problem, the VM starts in VBox but the vagrant up command times out. vagrant ssh seems to do nothing. Any other suggestions?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

Adam Turner

unread,
Feb 19, 2016, 7:33:39 AM2/19/16
to Vagrant
Hello again,

a) I can stop and start the virtual machine in virtualbox without any apparent problems.

b) I found this suggestion of trying precise32 on other forums, so that is what I was trying in my first post but it still has the same problem.

This is what made me wonder if it is a problem with the ssh itself. Possibly a problem with the port forwarding but disabling firewall and antivirus does not seem to help. Are there any other programs and or settings that may be causing the ssh to fail? Or diagnostics I could use to check whether the port forwarding is working?

Thanks.

Alvaro Miranda Aguilera

unread,
Feb 19, 2016, 8:03:57 AM2/19/16
to vagra...@googlegroups.com
Hello Adam,

If you do vagrant up

then do vagrant ssh-config it should tell the port forwarded 

Then using the web browser you can try to reach that port. ie


it should return protocol-error since its ssh and not https, but will help to see the port.

Other test will be use putty or ssh command from your OS and see if you get a prompt.

Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.

Adam Turner

unread,
Feb 19, 2016, 9:13:21 AM2/19/16
to Vagrant
I am not at home at the moment so cannot check the exact error I get but when I tried to ssh to the forwarded port using git bash, I could not connect. I will try when I get home and post back with the exact message if that will be useful.

Adam Turner

unread,
Feb 19, 2016, 3:32:41 PM2/19/16
to Vagrant
Hi Alvaro,

I tried what you suggested and just got "connection refused". I may have now fixed my problem although I don't really understand how!

I was googling how to enable ssh in windows 10 and came across this post:


It includes the following instructions:

1. Press the + R keys to open the Run dialog.
2. Type inetcpl.cpl, and click/tap on OK.

3. Click on Connections tab.

4. Click on LAN settings button on the bottom. A LAN Settings Windows will open.

5. un-check "Automatically detect settings" and check on "Use a proxy server for your LAN..."

6. Click on "Advanced" button. A Proxy Settings window will open.

7. ONLY FILL the socks information, for example... Socks: 127.0.0.1 and port 1080 (leave everything else blank)

8. Uncheck "Use the same proxy server for all protocols." Click OK. Step 7 was only the thing that changed in my previous attempts.


So I followed the above and could ssh into my VM but lost my connection to the web. So I re-ticked "automatically detect settings" and unticked "Use a proxy server for your LAN..." and now both ssh and the web seem to work.


Thanks for your help,


Adam

Alvaro Miranda Aguilera

unread,
Feb 19, 2016, 6:21:49 PM2/19/16
to vagra...@googlegroups.com
Hello,

I don't know for sure. But if you are using powershell then that may explain.

Powershell will inherit proxy details from IE settings, so if you have a proxy setting that say all traffic for all ports should go to this proxy, then that may explain the issue.

glad you got past that!
Alvaro.


Reply all
Reply to author
Forward
0 new messages