From 993256643d6b87512841d73fd38054629a0f5b05 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 12 Apr 2014 15:59:53 -0700 Subject: [PATCH] guests/windows: rdp_info cap --- plugins/guests/windows/cap/rdp.rb | 20 ++++++++++++++++++++ plugins/guests/windows/plugin.rb | 5 +++++ 2 files changed, 25 insertions(+) create mode 100644 plugins/guests/windows/cap/rdp.rb diff --git a/plugins/guests/windows/cap/rdp.rb b/plugins/guests/windows/cap/rdp.rb new file mode 100644 index 000000000..ae53f7b38 --- /dev/null +++ b/plugins/guests/windows/cap/rdp.rb @@ -0,0 +1,20 @@ +module VagrantPlugins + module GuestWindows + module Cap + class RDP + def self.rdp_info(machine) + ssh_info = machine.ssh_info + username = ssh_info[:username] + if machine.config.vm.communicator == :winrm + username = machine.config.winrm.username + end + + return { + host: ssh_info[:host], + username: username, + } + end + end + end + end +end diff --git a/plugins/guests/windows/plugin.rb b/plugins/guests/windows/plugin.rb index fa1408314..c5e74a629 100644 --- a/plugins/guests/windows/plugin.rb +++ b/plugins/guests/windows/plugin.rb @@ -49,6 +49,11 @@ module VagrantPlugins Cap::MountSharedFolder end + guest_capability(:windows, :rdp_info) do + require_relative "cap/rdp" + Cap::RDP + end + guest_capability(:windows, :wait_for_reboot) do require_relative "cap/reboot" Cap::Reboot