Merge pull request #67 from thematthopkins/windows_guests

Fix for windows guests running on non-windows hosts.
This commit is contained in:
Paulo Bittencourt 2014-04-27 11:14:12 -04:00
commit ae7ac77efa
1 changed files with 5 additions and 1 deletions

View File

@ -10,7 +10,11 @@ module VagrantPlugins
realhostfile = '/etc/inet/hosts'
move_cmd = 'mv'
elsif (machine.communicate.test("test -d $Env:SystemRoot"))
realhostfile = "#{ENV['WINDIR']}\\System32\\drivers\\etc\\hosts"
windir = ""
machine.communicate.execute("echo %SYSTEMROOT%", {:shell => :cmd}) do |type, contents|
windir << contents.gsub("\r\n", '') if type == :stdout
end
realhostfile = "#{windir}\\System32\\drivers\\etc\\hosts"
move_cmd = 'mv -force'
else
realhostfile = '/etc/hosts'