lib/vagrant-windows/windows_machine.rb in vagrant-windows-1.3.0 vs lib/vagrant-windows/windows_machine.rb in vagrant-windows-1.3.1

- old
+ new

@@ -24,10 +24,17 @@ # @return [Boolean] def is_vmware?() @machine.provider_name.to_s().start_with?('vmware') end + # Checks to see if the machine is using Oracle VirtualBox. + # + # @return [Boolean] + def is_virtualbox?() + @machine.provider_name.to_s().start_with?('virtualbox') + end + # Checks to see if the machine is rebooting or has a scheduled reboot. # # @return [Boolean] True if rebooting def is_rebooting?() reboot_detect_script = VagrantWindows.load_script('reboot_detect.ps1') @@ -48,14 +55,18 @@ def read_mac_addresses() @machine.provider.driver.read_mac_addresses end # Returns a list of forwarded ports for a VM. - # NOTE: For VMWare this is currently unsupported. + # NOTE: Only the VBox provider currently supports this method # # @return [Array<Array>] def read_forwarded_ports() - is_vmware?() ? [] : @machine.provider.driver.read_forwarded_ports + if is_virtualbox?() + @machine.provider.driver.read_forwarded_ports + else + [] + end end # Returns the SSH config for this machine. # # @return [Hash] \ No newline at end of file