Merge pull request #1366 from johnb0011/master

Solve Virtualbox pathing issue running under Cygwin
This commit is contained in:
Mitchell Hashimoto 2013-03-13 21:41:34 -07:00
commit 57a5edbc39
3 changed files with 11 additions and 1 deletions

View File

@ -14,6 +14,10 @@ module Vagrant
platform.include?("darwin9")
end
def cygwin?
platform.include?("cygwin")
end
[:darwin, :bsd, :freebsd, :linux, :solaris].each do |type|
define_method("#{type}?") do
platform.include?(type.to_s)

View File

@ -12,6 +12,9 @@ module VagrantPlugins
# Import the virtual machine
ovf_file = env[:machine].box.directory.join("box.ovf").to_s
if Vagrant::Util::Platform.cygwin?
ovf_file = `cygpath -m '#{ovf_file}'`.chomp
end
env[:machine].id = env[:machine].provider.driver.import(ovf_file) do |progress|
env[:ui].clear_line
env[:ui].report_progress(progress, 100, false)

View File

@ -25,7 +25,7 @@ module VagrantPlugins
# Set the path to VBoxManage
@vboxmanage_path = "VBoxManage"
if Vagrant::Util::Platform.windows?
if Vagrant::Util::Platform.windows? || Vagrant::Util::Platform.cygwin?
@logger.debug("Windows. Trying VBOX_INSTALL_PATH for VBoxManage")
# On Windows, we use the VBOX_INSTALL_PATH environmental
@ -33,6 +33,9 @@ module VagrantPlugins
if ENV.has_key?("VBOX_INSTALL_PATH")
# Get the path.
path = ENV["VBOX_INSTALL_PATH"]
if Vagrant::Util::Platform.cygwin?
path = `cygpath -u '#{path}'`.chomp
end
@logger.debug("VBOX_INSTALL_PATH value: #{path}")
# There can actually be multiple paths in here, so we need to