{"record":{"id":"0131dc9b5ae79e6c","repo":"hashicorp/vagrant","slug":"vagrant-expected-to-find-a-storage-controller-call","errorCode":null,"errorMessage":"Vagrant expected to find a storage controller called '%{name}',\nbut there is no controller with this name attached to the current VM.\nIf you have changed or removed any storage controllers, please restore\nthem to their previous configuration.","messagePattern":"Vagrant expected to find a storage controller called '%(.+?)',\nbut there is no controller with this name attached to the current VM\\.\nIf you have changed or removed any storage controllers, please restore\nthem to their previous configuration\\.","errorType":"exception","errorClass":"Vagrant::Errors.VirtualBoxDisksControllerNotFound","httpStatus":null,"severity":"error","filePath":"plugins/providers/virtualbox/model/storage_controller_array.rb","lineNumber":20,"sourceCode":"# SPDX-License-Identifier: BUSL-1.1\n\nrequire_relative \"../cap/validate_disk_ext\"\n\nmodule VagrantPlugins\n  module ProviderVirtualBox\n    module Model\n      # A collection of storage controllers. Includes finder methods to look\n      # up a storage controller by given attributes.\n      class StorageControllerArray < Array\n        # Returns a storage controller with the given name. Raises an\n        # exception if a matching controller can't be found.\n        #\n        # @param [String] name - The name of the storage controller\n        # @return [VagrantPlugins::ProviderVirtualBox::Model::StorageController]\n        def get_controller(name)\n          controller = detect { |c| c.name == name }\n          if !controller\n            raise Vagrant::Errors::VirtualBoxDisksControllerNotFound, name: name\n          end\n          controller\n        end\n\n        # Find the controller containing the primary disk (i.e. the boot\n        # disk). This is used to determine which controller virtual disks\n        # should be attached to.\n        #\n        # Raises an exception if no supported controllers are found.\n        #\n        # @return [VagrantPlugins::ProviderVirtualBox::Model::StorageController]\n        def get_primary_controller\n          ordered = find_all(&:supported?).sort_by(&:boot_priority)\n          controller = ordered.detect { |c| c.attachments.any? { |a| hdd?(a) } }\n\n          if !controller\n            raise Vagrant::Errors::VirtualBoxDisksNoSupportedControllers,\n              supported_types: supported_types.join(\", \")","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/virtualbox/model/storage_controller_array.rb#L2-L38","documentation":"The disk-management feature looks up storage controllers by name via StorageControllerArray#get_controller, which raises VirtualBoxDisksControllerNotFound when no attached controller matches the requested name. It is called from configure_disks/cleanup_disks whenever Vagrant needs the controller a disk is (or was) attached to. The mismatch is between the controller name recorded in the disk metadata/Vagrantfile and what `VBoxManage showvminfo` actually reports for the VM.","triggerScenarios":"A `config.vm.disk` entry (or disk state stored under .vagrant) references controller_name X, but `showvminfo` shows no storage controller named X — after controllers were renamed/removed in the VirtualBox GUI, a box was rebuilt with a different controller layout, or the disk config names a controller that never existed.","commonSituations":"User edited storage controllers in the VirtualBox GUI after the VM was created; switching a box to one that uses 'IDE Controller' vs 'SATA Controller' naming; leftover disk metadata from experiments with the (evolving) disk feature; non-English VirtualBox installs reporting localized controller names.","solutions":["List the VM's real controllers: `VBoxManage showvminfo <uuid> --machinereadable | grep storagecontrollername`","Restore the missing controller in the VirtualBox GUI with the exact name Vagrant expects, or update the Vagrantfile disk config to use an existing controller name","If the disk config is stale, remove the `config.vm.disk` blocks, run `vagrant up` so cleanup succeeds, then re-add them","Worst case: `vagrant destroy && vagrant up` to rebuild the VM with a consistent controller set"],"exampleFix":"# Vagrantfile — before (controller name not attached to this VM)\nconfig.vm.disk :disk, size: \"10GB\", controller: \"SCSI Controller\"\n# after — match a controller shown by `VBoxManage showvminfo <uuid>`, or omit the option\nconfig.vm.disk :disk, size: \"10GB\", controller: \"SATA Controller\"","handlingStrategy":"validation","validationCode":"names = `VBoxManage showvminfo #{uuid} --machinereadable`.scan(/^storagecontrollername\\d+=\"(.+)\"/).flatten\nraise 'controller missing - fix disk config' unless names.include?(expected_controller_name)","typeGuard":"def controller_attached?(uuid, name)\n  `VBoxManage showvminfo #{uuid} --machinereadable`.scan(/^storagecontrollername\\d+=\"(.+)\"/).flatten.include?(name)\nend","tryCatchPattern":null,"preventionTips":["Do not rename/remove storage controllers in the VirtualBox GUI on Vagrant-managed VMs","Keep `config.vm.disk` controller names exactly as showvminfo reports them","Remove disk config blocks before restructuring a VM's storage, then re-add them"],"tags":["virtualbox","storage-controller","disk","disk-management"],"backgroundTag":"storage-controller-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}