plugins/providers/virtualbox/driver/base.rb in vagrant-unbundled-1.9.1.1 vs plugins/providers/virtualbox/driver/base.rb in vagrant-unbundled-1.9.5.1
- old
+ new
@@ -64,9 +64,19 @@
if File.file?(path)
@vboxmanage_path = path
break
end
end
+ elsif Vagrant::Util::Platform.wsl?
+ if !Vagrant::Util::Platform.wsl_windows_access?
+ @logger.error("No user Windows access defined for the Windows Subsystem for Linux. This is required for VirtualBox.")
+ raise Vagrant::Errors::WSLVirtualBoxWindowsAccessError
+ end
+ @logger.debug("Linux platform detected but executing within WSL. Locating VBoxManage.")
+ @vboxmanage_path = Vagrant::Util::Which.which("VBoxManage") || Vagrant::Util::Which.which("VBoxManage.exe")
+ if !@vboxmanage_path
+ raise Vagrant::Errors::VBoxManageNotFoundWSLError
+ end
end
# Fall back to hoping for the PATH to work out
@vboxmanage_path ||= "VBoxManage"
@logger.info("VBoxManage path: #{@vboxmanage_path}")