New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vagrant ssh
cannot connect to remote host
#1936
Comments
This honestly looks like an issue with the box, rather than Vagrant. At this point, it isn't even Vagrant because it is exec'ing to |
@mitchellh The same Vagrantfile, box and provisioning are working on MacOS 10.8 and the problem is occuring on Ubuntu 12.04. I don't know if the OS matters, but I am pretty sure the configuration is correct, because of that. |
@mitchellh I hope I don't bother you very much, but I really need some kind of a clue how to fix this. I've just noticed the host for the ssh command is But in the Vagrantfile I have Here is it: # -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "cl_debian_7"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.synced_folder Dir.pwd, "/vagrant", :nfs => true
config.ssh.forward_agent = true
config.vm.provider :virtualbox do |vb|
vb.customize [
"modifyvm", :id,
"--name", "Cain",
"--memory", "1024",
"--rtcuseutc", "on"
]
end
config.vm.provision :shell, :path => "provision/install.sh"
end Unfortunately when I try to ssh manually into the VM it is not working no matter the host IP. |
Vagrant always attempts to connect using a forwarded port, not the private network, s it will always use 127.0.0.1. Again, if you can't get SSH to work manually, then I can't really help with the Vagrant side because it is probably not a Vagrant issue. Once you can SSH in manually using the same methods as Vagrant (run |
I have the same problem, the box is a precise not modified. I tried manually to connect and nothing happen. INFO ssh: Invoking SSH: ["vagrant@127.0.0.1", "-p", "2222", "-o", "DSAAuthentication=yes", "-o", "LogLevel=FATAL", "-o", "Stri any clue how to dig this issue ? |
I have the same issue as described above.
|
For those having an issue, as @mitchellh says it may well be a problem with the box, rather than vagrant.
Luckily if you start the box using VirtualBox manager you can login to the console (user and password vagrant) and I was able to reinstall the missing packages, performed a reboot et vola, it all worked... Strongly suggest you login via VB/VM console and have a wander, you may find the ssh server didn't start or some other error that prevented the |
The solution for me was the following setting in ansible.cfg It was probably due to a box I used. |
Encountered the same issue and later realized that virtualization is not enabled on the host machine. |
@cstewart87 you can determine if virtualization is enabled on your computer's BIOS |
For reference, this happened to me because I mistakenly tried to add ssh forwarding via packer by appending the |
I'm using a CoreOS box, and I often log into my clients' or my own VPN (virtual private network). This generally does not cause any issues, but once in awhile I suspect that it is causing SSH to stop working. My solution is to halt and restart the machine. See below for my output:
|
I have the same issue.
Any solution ?
...
DEBUG virtualbox_5_0: - [1, "ssh", 2222, 22]
DEBUG virtualbox_5_0: - [1, "tcp8000", 8000, 80]
INFO ssh: Attempting SSH connection...
INFO ssh: Attempting to connect to SSH...
INFO ssh: - Host: 127.0.0.1
INFO ssh: - Port: 2222
INFO ssh: - Username: vagrant
INFO ssh: - Password? false
INFO ssh: - Key Path: ["C:/Users/hkpc/.vagrant.d/insecure_private_key"]
DEBUG ssh: == Net-SSH connection debug-level log START ==
DEBUG ssh: D, [2015-11-21T20:36:05.004327 #10680] DEBUG -- net.ssh.transport.session[1566c60]: establishing connection to 127.0.0.1:2222
D, [2015-11-21T20:36:05.012328 #10680] DEBUG -- net.ssh.transport.session[1566c60]: connection established
I, [2015-11-21T20:36:05.016829 #10680] INFO -- net.ssh.transport.server_version[1574c7c]: negotiating protocol version
|
@alberto56 Thanks for your solution. That works for me. |
If you have a designated ssh port in the Vagrantfile you should compare it to the actual port vagrant is running ssh on. Sometimes with multiple instances running the port-conflict-auto-correction can cause you to mess up your configs (i.e. 2222 vs 2200). |
Here is my debug log:
https://gist.github.com/hkdobrev/6012545
The relevant part:
The problem occurs on both
vagrant up
andvagrant ssh
.When running
vagrant up
everything hangs and if I interupt itvagrant status
showsrunning
.Then
vagrant ssh
produces the given output.Things I have tried:
~/.vagrant.d/
(had some old files there from perviously installed vagrant 1.0.x).Vagrant version: 1.2.3
The text was updated successfully, but these errors were encountered: