diff --git a/plugins/providers/docker/action/host_machine_sync_folders.rb b/plugins/providers/docker/action/host_machine_sync_folders.rb index 7fa25ac3e..122b62f63 100644 --- a/plugins/providers/docker/action/host_machine_sync_folders.rb +++ b/plugins/providers/docker/action/host_machine_sync_folders.rb @@ -148,6 +148,9 @@ module VagrantPlugins action_env = { synced_folders_config: new_config } begin host_machine.action(:sync_folders, action_env) + rescue Vagrant::Errors::MachineLockedError + sleep 1 + retry rescue Vagrant::Errors::UnimplementedProviderAction callable = Vagrant::Action::Builder.new callable.use Vagrant::Action::Builtin::SyncedFolders diff --git a/plugins/providers/docker/action/host_machine_sync_folders_disable.rb b/plugins/providers/docker/action/host_machine_sync_folders_disable.rb index b7912d93a..0acd0c6d4 100644 --- a/plugins/providers/docker/action/host_machine_sync_folders_disable.rb +++ b/plugins/providers/docker/action/host_machine_sync_folders_disable.rb @@ -72,6 +72,9 @@ module VagrantPlugins begin host_machine.action(:sync_folders, action_env) + rescue Vagrant::Errors::MachineLockedError + sleep 1 + retry rescue Vagrant::Errors::UnimplementedProviderAction callable = Vagrant::Action::Builder.new callable.use Vagrant::Action::Builtin::SyncedFolders