hashicorp/vagrant · warning

Vagrant has noticed that the synced folder definitions have

Error message

Vagrant has noticed that the synced folder definitions have changed.
With Docker, these synced folder changes won't take effect until you
destroy the container and recreate it.

What it means

The Docker provider cannot live-update a running container's synced-folder mounts. The compare_synced_folders action diffs each configured folder (expanded guestpath to hostpath) against what the container recorded; if any entry is new or changed, or existing entries were removed, it warns that the changes only take effect after destroying and recreating the container.

Source

Thrown at plugins/providers/docker/action/compare_synced_folders.rb:57

                invalid = true
              else
                old = File.expand_path(old)
              end

              if !invalid && old
                invalid = true if old != File.expand_path(data[:hostpath])
              end

              if invalid
                invalids[File.expand_path(data[:guestpath])] = File.expand_path(data[:hostpath])
              end
            end
          end

          # If we have invalid entries, these are changed or new entries.
          # If we have existing entries, then we removed some entries.
          if !invalids.empty? || !existing.empty?
            machine.ui.warn(I18n.t("docker_provider.synced_folders_changed"))
          end

          @app.call(env)
        end
      end
    end
  end
end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Recreate the container: `vagrant destroy -f && vagrant up`
  2. Use rsync-type synced folders and `vagrant rsync` / `vagrant rsync-auto` to push changes without recreation
  3. Revert the Vagrantfile edit if the change was unintended and the old mounts are fine

Example fix

# before
vagrant reload    # warns: new mounts won't apply
# after
vagrant destroy -f && vagrant up   # container rebuilt with new mounts
Defensive patterns

Strategy: validation

Validate before calling

# Preflight: see what the container currently mounts before editing config
vagrant ssh -c "mount | grep -v proc" || true

Prevention

When it happens

Trigger: Editing config.vm.synced_folder entries (new folder, changed host/guest path, removal) in a Vagrantfile for a docker-provider machine, then running `vagrant up` or `vagrant reload` against the existing container.

Common situations: Iterating on mount lists during development; adding a folder to a long-running container; switching a host path after moving the project.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/716b102bcb1a779d. Report an issue: GitHub.