Attaching a SATA storage controller in VirtualBox is straightforward. Sometimes, you need to attach SATA hard disks to specific virtual machines rather than the default IDE disks. This post explains how to add SATA hard disk (virtual disk) to virtual machines in the VirtualBox console and CLI (Command Line Interface). This method applies to any host, such as Windows, Linux, and Mac.
VirtualBox supports Intel AHCI-type SATA controllers. By default, virtual machines will be created with IDE controllers only. Before powering virtual machines, you can change this controller in the console view or CLI.
To Add SATA Controllers in VirtualBox – Console View
1) Go to Storage settings
2) You may have to remove the existing storage controller and hard disk by clicking the remove button, as shown below. Remember, by removing the controller and hard disk from the virtual machine; we are not deleting the existing virtual hard disk (VDI) file. It will remain at the location.
Note – Keep IDE Controller for CD/DVD drives. CD/DVD drives cannot be added to SATA controllers in VirtualBox.
3) Click on Add controller button and select SATA controller.
4) As mentioned earlier, it supports AHCI type only, so you can’t play with it. Add the hard disk button from the SATA controller and select the existing hard disk.
5) That’s it. We successfully added a SATA controller to a virtual machine in Oracle VirtualBox. After adding the controller, you can create or use the existing virtual hard disk and attach it to it.
Whenever you get booting errors from ‘Physical to Virtual’ converted disk files, you can change this controller setting and try different options until the booting issue gets resolved.
For example, when you convert a physical machine running with the SATA controller to the virtual environment, as mentioned in an earlier post, you can try it with the SATA controller option in VirtualBox.
Add SATA Controllers in VirtualBox By CLI
Ensure you run the VBoxManage command from the correct installation location or you have already added it to the Windows path variable.
1) First, add the controller with the following command
VBoxManage storagectl OSX –name “SATA Controller” –add sata –controller IntelAHCI
OSX – is the Virtual Machine name (UUID also applicable).
2) Add the hard disk to the controller with the following command
VBoxManage storageattach OSX –storagectl “SATA Controller” –type hdd –port 0 –device 0 –medium D:/MAC/OSX/OSX.vmdk
D:/MAC/OSX/OSX.vmdk – Location of Hard disk.
VBoxManage createhd –filenameD: /MAC/OSX/OSX.vmdk –size 10240 to create Hard disk.
Do you want to try the same command to add CD or DVD drive? I tried and got the following error.
Error: The Attachment is not supported by the Storage Controller: ‘SATA Controller’
As SATA carries more advantages, you can get more benefits by attaching the virtual disk to the SATA controller. I hope this guide helps connect the virtual hard disk through the SATA port for a VM in VirtualBox.