diff --git a/plugins/synced_folders/smb/errors.rb b/plugins/synced_folders/smb/errors.rb index d1279563a..b9923774c 100644 --- a/plugins/synced_folders/smb/errors.rb +++ b/plugins/synced_folders/smb/errors.rb @@ -17,6 +17,10 @@ module VagrantPlugins class PowershellError < SMBError error_key(:powershell_error) end + + class WindowsHostRequired < SMBError + error_key(:windows_host_required) + end end end end diff --git a/plugins/synced_folders/smb/synced_folder.rb b/plugins/synced_folders/smb/synced_folder.rb index b5817038c..c843c6b30 100644 --- a/plugins/synced_folders/smb/synced_folder.rb +++ b/plugins/synced_folders/smb/synced_folder.rb @@ -16,7 +16,7 @@ module VagrantPlugins def usable?(machine, raise_error=false) if !Vagrant::Util::Platform.windows? - # TODO: raise error if specified + raise Errors::WindowsHostRequired if raise_error return false end diff --git a/templates/locales/synced_folder_smb.yml b/templates/locales/synced_folder_smb.yml index 451cb80af..509772a57 100644 --- a/templates/locales/synced_folder_smb.yml +++ b/templates/locales/synced_folder_smb.yml @@ -37,3 +37,7 @@ en: Error: %{stderr} + windows_host_required: |- + SMB shared folders are only available when Vagrant is running + on Windows. The guest machine can be running non-Windows. Please use + another synced folder type.