Call mstsc in WSL
This commit is contained in:
parent
6fc2d9d82d
commit
a01d68b2e0
|
@ -12,9 +12,13 @@ module VagrantPlugins
|
||||||
"xfreerdp"
|
"xfreerdp"
|
||||||
elsif Vagrant::Util::Which.which("rdesktop")
|
elsif Vagrant::Util::Which.which("rdesktop")
|
||||||
"rdesktop"
|
"rdesktop"
|
||||||
|
else
|
||||||
|
if Vagrant::Util::Platform.wsl?
|
||||||
|
"mstsc.exe"
|
||||||
else
|
else
|
||||||
raise Vagrant::Errors::LinuxRDPClientNotFound
|
raise Vagrant::Errors::LinuxRDPClientNotFound
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
|
@ -30,6 +34,17 @@ module VagrantPlugins
|
||||||
args << "-p" << rdp_info[:password] if rdp_info[:password]
|
args << "-p" << rdp_info[:password] if rdp_info[:password]
|
||||||
args += rdp_info[:extra_args] if rdp_info[:extra_args]
|
args += rdp_info[:extra_args] if rdp_info[:extra_args]
|
||||||
args << "#{rdp_info[:host]}:#{rdp_info[:port]}"
|
args << "#{rdp_info[:host]}:#{rdp_info[:port]}"
|
||||||
|
when "mstsc.exe"
|
||||||
|
# Setup password
|
||||||
|
cmdKeyArgs = [
|
||||||
|
"/add:#{rdp_info[:host]}:#{rdp_info[:port]}",
|
||||||
|
"/user:#{rdp_info[:username]}",
|
||||||
|
"/pass:#{rdp_info[:password]}",
|
||||||
|
]
|
||||||
|
Vagrant::Util::Subprocess.execute("cmdkey.exe", *cmdKeyArgs)
|
||||||
|
|
||||||
|
args = ["/v:#{rdp_info[:host]}:#{rdp_info[:port]}"]
|
||||||
|
args += rdp_info[:extra_args] if rdp_info[:extra_args]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finally, run the client.
|
# Finally, run the client.
|
||||||
|
|
Loading…
Reference in New Issue