2014-05-22 17:20:45 +00:00
|
|
|
require "pathname"
|
|
|
|
require "tmpdir"
|
2014-04-12 22:44:39 +00:00
|
|
|
|
2014-05-21 03:47:32 +00:00
|
|
|
require "vagrant/util/subprocess"
|
2014-04-12 22:44:39 +00:00
|
|
|
|
|
|
|
module VagrantPlugins
|
|
|
|
module HostWindows
|
|
|
|
module Cap
|
|
|
|
class RDP
|
|
|
|
def self.rdp_client(env, rdp_info)
|
2015-04-27 10:09:39 +00:00
|
|
|
# Setup password
|
2016-05-27 23:08:49 +00:00
|
|
|
cmdKeyArgs = [
|
|
|
|
"/add:#{rdp_info[:host]}:#{rdp_info[:port]}",
|
|
|
|
"/user:#{rdp_info[:username]}",
|
|
|
|
"/pass:#{rdp_info[:password]}",
|
|
|
|
]
|
|
|
|
Vagrant::Util::Subprocess.execute("cmdkey", *cmdKeyArgs)
|
|
|
|
|
2014-05-08 01:32:20 +00:00
|
|
|
# Build up the args to mstsc
|
2015-04-27 10:09:39 +00:00
|
|
|
args = ["/v:#{rdp_info[:host]}:#{rdp_info[:port]}"]
|
2014-05-08 01:32:20 +00:00
|
|
|
if rdp_info[:extra_args]
|
|
|
|
args = rdp_info[:extra_args] + args
|
|
|
|
end
|
2014-04-12 22:44:39 +00:00
|
|
|
# Launch it
|
2014-05-21 03:47:32 +00:00
|
|
|
Vagrant::Util::Subprocess.execute("mstsc", *args)
|
2014-04-12 22:44:39 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|