Fix for VBoxManage: error: Could not find a controller named 'SATA' Error


I was using this guide Resize a Hard Disk for a Virtual Machine to resize the hard disk for my vagrant machine (provisioned through virtual box). It is an ubuntu 18.04 image. I successfully managed to make a vdi clone and resize it.

When trying to reattach it with the following command

VBoxManage storageattach sitefit_default_1537859062545_25454 --storagectl "SATA" --port 0 --device 0 --type hdd --medium clone-disk1.vdi

I ran into the error

VBoxManage: error: Could not find a controller named 'SATA'

I tried googling around. While it did not give a direct solution, I realized that I should change the storagectl parameter. Paying a little closer attention to the result of the showvminfo command solved the issue.

~/V/sitefit_default_1537859062545_25454> VBoxManage showvminfo sitefit_default_1537859062545_25454 | grep "Storage"
Storage Controller Name (0):            IDE Controller
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            SCSI Controller
Storage Controller Type (1):            LsiLogic
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  16
Storage Controller Port Count (1):      16
Storage Controller Bootable (1):        on

--storagectl needs the storage control name. In the result above, the Storage Controller Name is set to IDE Controller. Making the same substitution in the above command results in success.

VBoxManage storageattach sitefit_default_1537859062545_25454 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium clone-disk1.vdi