From 2da21e3578f68198dd88bac74e9ac0de255c5f64 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 20 May 2014 19:55:36 -0700 Subject: [PATCH] hosts/linux: rdp_client cap [GH-3845] --- CHANGELOG.md | 1 + plugins/hosts/linux/cap/rdp.rb | 17 +++++++++++++++++ plugins/hosts/linux/plugin.rb | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 plugins/hosts/linux/cap/rdp.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 955b403c0..c55af6f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ FEATURES: IMPROVEMENTS: - commands/halt: Halt in reverse order of up, like destroy. [GH-3790] + - hosts/linux: Uses rdesktop to RDP into machines if available. [GH-3845] BUG FIXES: diff --git a/plugins/hosts/linux/cap/rdp.rb b/plugins/hosts/linux/cap/rdp.rb new file mode 100644 index 000000000..fd565a85b --- /dev/null +++ b/plugins/hosts/linux/cap/rdp.rb @@ -0,0 +1,17 @@ +module VagrantPlugins + module HostLinux + module Cap + class RDP + def self.rdp_client(env, rdp_info) + 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 diff --git a/plugins/hosts/linux/plugin.rb b/plugins/hosts/linux/plugin.rb index 668ff99f0..376a04465 100644 --- a/plugins/hosts/linux/plugin.rb +++ b/plugins/hosts/linux/plugin.rb @@ -26,6 +26,11 @@ module VagrantPlugins Cap::NFS end + host_capability("linux", "rdp_client") do + require_relative "cap/rdp" + Cap::RDP + end + # Linux-specific helpers we need to determine paths that can # be overriden. host_capability("linux", "nfs_apply_command") do