2014-05-21 02:58:12 +00:00
|
|
|
require "vagrant/util/which"
|
|
|
|
|
2014-05-21 02:55:36 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module HostLinux
|
|
|
|
module Cap
|
|
|
|
class RDP
|
|
|
|
def self.rdp_client(env, rdp_info)
|
2014-05-21 02:58:12 +00:00
|
|
|
if !Vagrant::Util::Which.which("rdesktop")
|
|
|
|
raise Vagrant::Errors::LinuxRDesktopNotFound
|
|
|
|
end
|
|
|
|
|
2014-05-21 02:55:36 +00:00
|
|
|
args = []
|
|
|
|
args << "-u" << rdp_info[:username]
|
|
|
|
args << "-p" << rdp_info[:password] if rdp_info[:password]
|
|
|
|
args += rdp_info[:extra_args] if rdp_info[:extra_args]
|
|
|
|
args << "#{rdp_info[:host]}:#{rdp_info[:port]}"
|
|
|
|
|
|
|
|
Vagrant::Util::Subprocess.execute("rdesktop", *args)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|