{"record":{"id":"001737b15232123a","repo":"hashicorp/vagrant","slug":"an-active-machine-was-found-with-a-different-provi","errorCode":null,"errorMessage":"An active machine was found with a different provider. Vagrant\ncurrently allows each machine to be brought up with only a single\nprovider at a time. A future version will remove this limitation.\nUntil then, please destroy the existing machine to up with a new\nprovider.\n\nMachine name: %{name}\nActive provider: %{active_provider}\nRequested provider: %{requested_provider}","messagePattern":"An active machine was found with a different provider\\. Vagrant\ncurrently allows each machine to be brought up with only a single\nprovider at a time\\. A future version will remove this limitation\\.\nUntil then, please destroy the existing machine to up with a new\nprovider\\.\n\nMachine name: %(.+?)\nActive provider: %(.+?)\nRequested provider: %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::ActiveMachineWithDifferentProvider","httpStatus":null,"severity":"error","filePath":"lib/vagrant/plugin/v2/command.rb","lineNumber":163,"sourceCode":"              rescue Vagrant::Errors::EnvironmentNonExistentCWD\n                # This means that this environment working directory\n                # no longer exists, so delete this entry.\n                entry = @env.machine_index.get(name.to_s)\n                @env.machine_index.delete(entry) if entry\n                raise\n              end\n\n              next env.machine(entry.name.to_sym, entry.provider.to_sym)\n            end\n\n            active_machines.each do |active_name, active_provider|\n              if name == active_name\n                # We found an active machine with the same name\n\n                if provider_to_use && provider_to_use != active_provider\n                  # We found an active machine with a provider that doesn't\n                  # match the requested provider. Show an error.\n                  raise Errors::ActiveMachineWithDifferentProvider,\n                    name: active_name.to_s,\n                    active_provider: active_provider.to_s,\n                    requested_provider: provider_to_use.to_s\n                else\n                  # Use this provider and exit out of the loop. One of the\n                  # invariants [for now] is that there shouldn't be machines\n                  # with multiple providers.\n                  @logger.info(\"Active machine found with name #{active_name}. \" +\n                               \"Using provider: #{active_provider}\")\n                  provider_to_use = active_provider\n                  break\n                end\n              end\n            end\n\n            # Use the default provider if nothing else\n            provider_to_use ||= @env.default_provider(machine: name)\n","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/plugin/v2/command.rb#L145-L181","documentation":"with_target_vms found the named machine already active in the machine index under one provider while the command explicitly requested a different provider via --provider (lib/vagrant/plugin/v2/command.rb:163). Vagrant enforces one provider per machine at a time, so it refuses to create a second instance; the message names the machine, the active provider, and the requested one.","triggerScenarios":"`vagrant up myvm --provider=vmware_desktop` when myvm is currently up (or indexed) under virtualbox; same for hyperv <-> virtualbox switches; also when a CI script hardcodes --provider against an already-created machine.","commonSituations":"Migrating a machine between providers without destroying first; leftover index entry after a crashed or interrupted destroy; teammates sharing a project root with different provider defaults.","solutions":["If you truly want the other provider: `vagrant destroy <name>` (or destroy the global-status entry), then `vagrant up <name> --provider=<new>`","If you just want it running: drop the --provider flag and let Vagrant reuse the active provider","If the machine was already destroyed but the error persists, the index entry is stale — run `vagrant global-status --prune` or destroy the listed entry to clear it"],"exampleFix":"# before (web is active under virtualbox)\nvagrant up web --provider=vmware_desktop\n\n# after\nvagrant destroy web\nvagrant up web --provider=vmware_desktop","handlingStrategy":"validation","validationCode":"entry = env.active_machines.find { |n, _| n == name.to_sym }\nif entry && provider && entry[1] != provider\n  abort \"#{name} is active under #{entry[1]}; destroy it first or omit --provider\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  command.with_target_vms([name], provider: provider) { |m| operate(m) }\nrescue Vagrant::Errors::ActiveMachineWithDifferentProvider => e\n  d = e.extra_data # {name:, active_provider:, requested_provider:}\n  warn \"#{d[:name]} runs under #{d[:active_provider]}; destroy it or drop --provider\"\nend","preventionTips":["Do not hardcode --provider in scripts; let the stored provider win for existing machines","Treat switching providers as an explicit migration: destroy, then up with --provider","Prune stale index entries periodically with `vagrant global-status --prune`"],"tags":["provider","machine-index","conflict","vm-selection"],"backgroundTag":"provider-conflict","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}