diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 4204369f1..3a8873e1b 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -396,6 +396,10 @@ module Vagrant error_key(:linux_nfs_mount_failed) end + class LinuxRDesktopNotFound < VagrantError + error_key(:linux_rdesktop_not_found) + end + class LocalDataDirectoryNotAccessible < VagrantError error_key(:local_data_dir_not_accessible) end diff --git a/plugins/hosts/linux/cap/rdp.rb b/plugins/hosts/linux/cap/rdp.rb index fd565a85b..7146ef890 100644 --- a/plugins/hosts/linux/cap/rdp.rb +++ b/plugins/hosts/linux/cap/rdp.rb @@ -1,8 +1,14 @@ +require "vagrant/util/which" + module VagrantPlugins module HostLinux module Cap class RDP def self.rdp_client(env, rdp_info) + if !Vagrant::Util::Which.which("rdesktop") + raise Vagrant::Errors::LinuxRDesktopNotFound + end + args = [] args << "-u" << rdp_info[:username] args << "-p" << rdp_info[:password] if rdp_info[:password] diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 9c632eca4..6a38adcc4 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -756,6 +756,10 @@ en: that the NFS client software is properly installed, and consult any resources specific to the linux distro you're using for more information on how to do this. + linux_rdesktop_not_found: |- + The `rdesktop` application was not found. Vagrant requires this + in order to connect via RDP to the Vagrant environment. Please ensure + this application is installed and available on the path and try again. machine_action_locked: |- An action '%{action}' was attempted on the machine '%{name}', but another process is already executing an action on the machine.