diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 9665eecea..3822786e0 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -374,6 +374,10 @@ module Vagrant error_key(:ssh_disconnected) end + class SSHHostDown < VagrantError + error_key(:ssh_host_down) + end + class SSHKeyBadPermissions < VagrantError status_code(12) error_key(:ssh_key_bad_permissions) diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 24ee55eb7..a38d8e0ce 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -184,6 +184,9 @@ module VagrantPlugins rescue Errno::ECONNREFUSED # This is raised if we failed to connect the max amount of times raise Vagrant::Errors::SSHConnectionRefused + rescue Errno::EHOSTDOWN + # This is raised if we get an ICMP DestinationUnknown error. + raise Vagrant::Errors::SSHHostDown rescue NotImplementedError # This is raised if a private key type that Net-SSH doesn't support # is used. Show a nicer error. diff --git a/templates/locales/en.yml b/templates/locales/en.yml index f8dbb3582..f9a4603eb 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -201,6 +201,10 @@ en: usually indicates that SSH within the guest machine was unable to properly start up. Please boot the VM in GUI mode to check whether it is booting properly. + ssh_host_down: |- + While attempting to connect with SSH, a "host is down" (EHOSTDOWN) + error was received. Please verify your SSH settings are correct + and try again. ssh_key_bad_permissions: |- The private key to connect to this box via SSH has invalid permissions set on it. The permissions of the private key should be set to 0600, otherwise SSH will