{"record":{"id":"2b89ba7bd696c3cb","repo":"hashicorp/vagrant","slug":"virtualbox-does-not-support-shrinking-disk-sizes-2b89ba","errorCode":null,"errorMessage":"VirtualBox does not support shrinking disk sizes. Cannot shrink '%{name}' disks size.","messagePattern":"VirtualBox does not support shrinking disk sizes\\. Cannot shrink '%(.+?)' disks size\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/providers/virtualbox/cap/configure_disks.rb","lineNumber":230,"sourceCode":"            dvd_metadata[:device] = dsk_info[:device]\n            dvd_metadata[:uuid] = attachment[:uuid]\n            dvd_metadata[:controller] = controller.name\n          end\n\n          dvd_metadata\n        end\n\n        # Check to see if current disk is configured based on defined_disks\n        #\n        # @param [Kernel_V2::VagrantConfigDisk] disk_config\n        # @param [Hash] defined_disk\n        # @return [Boolean]\n        def self.compare_disk_size(machine, disk_config, defined_disk)\n          requested_disk_size = Vagrant::Util::Numeric.bytes_to_megabytes(disk_config.size)\n          defined_disk_size = defined_disk[:capacity].split(\" \").first.to_f\n\n          if defined_disk_size > requested_disk_size\n            machine.ui.warn(I18n.t(\"vagrant.cap.configure_disks.shrink_size_not_supported\", name: disk_config.name))\n            return false\n          elsif defined_disk_size < requested_disk_size\n            return true\n          else\n            return false\n          end\n        end\n\n        # Creates and attaches a disk to a machine\n        #\n        # @param [Vagrant::Machine] machine\n        # @param [Kernel_V2::VagrantConfigDisk] disk_config\n        # @param [VagrantPlugins::ProviderVirtualBox::Model::StorageController] controller -\n        # the storage controller to use\n        def self.create_disk(machine, disk_config, controller)\n          machine.ui.detail(I18n.t(\"vagrant.cap.configure_disks.create_disk\", name: disk_config.name))\n          # NOTE: At the moment, there are no provider specific configs for VirtualBox\n          # but we grab it anyway for future use.","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/virtualbox/cap/configure_disks.rb#L212-L248","documentation":"Error \"VirtualBox does not support shrinking disk sizes. Cannot shrink '%{name}' disks size.\" thrown in hashicorp/vagrant.","triggerScenarios":"Thrown at plugins/providers/virtualbox/cap/configure_disks.rb:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}