diff --git a/lib/vagrant/action/builtin/mixin_synced_folders.rb b/lib/vagrant/action/builtin/mixin_synced_folders.rb index 42e3a290f..b636d3526 100644 --- a/lib/vagrant/action/builtin/mixin_synced_folders.rb +++ b/lib/vagrant/action/builtin/mixin_synced_folders.rb @@ -112,10 +112,12 @@ module Vagrant raise "Internal error. Report this as a bug. Invalid: #{data[:type]}" end - if !impl_class[0].new.usable?(machine, true) - # Verify that explicitly defined shared folder types are - # actually usable. - raise Errors::SyncedFolderUnusable, type: data[:type].to_s + if !opts[:disable_usable_check] + if !impl_class[0].new.usable?(machine, true) + # Verify that explicitly defined shared folder types are + # actually usable. + raise Errors::SyncedFolderUnusable, type: data[:type].to_s + end end end diff --git a/plugins/providers/virtualbox/action/prepare_nfs_settings.rb b/plugins/providers/virtualbox/action/prepare_nfs_settings.rb index b7a92d1ac..9835f0f43 100644 --- a/plugins/providers/virtualbox/action/prepare_nfs_settings.rb +++ b/plugins/providers/virtualbox/action/prepare_nfs_settings.rb @@ -20,6 +20,7 @@ module VagrantPlugins opts = { cached: !!env[:synced_folders_cached], config: env[:synced_folders_config], + disable_usable_check: !!env[:test], } folders = synced_folders(env[:machine], **opts) diff --git a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb index 8acc6fa28..dfef293ec 100644 --- a/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb +++ b/test/unit/plugins/providers/virtualbox/action/prepare_nfs_settings_test.rb @@ -25,6 +25,10 @@ describe VagrantPlugins::ProviderVirtualBox::Action::PrepareNFSSettings do subject { described_class.new(app, env) } + before do + env[:test] = true + end + it "calls the next action in the chain" do called = false app = lambda { |*args| called = true }