From d1c28266fa2fdf4426d1565cbef060f70e3eb969 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 14 Aug 2014 23:53:01 -0400 Subject: [PATCH] VBOX: with VirtualBox 4.3 they renamed the 'IntelAHCI' disk controller to 'AHCI'. Automatically adjust depending on the installer version of VirtualBox. --- samples/vboxwrapper/vbox.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/samples/vboxwrapper/vbox.cpp b/samples/vboxwrapper/vbox.cpp index e984928bd7..fb9a78e4ab 100644 --- a/samples/vboxwrapper/vbox.cpp +++ b/samples/vboxwrapper/vbox.cpp @@ -688,7 +688,15 @@ int VBOX_VM::create_vm() { command = "storagectl \"" + vm_name + "\" "; command += "--name \"Hard Disk Controller\" "; command += "--add \"" + vm_disk_controller_type + "\" "; - command += "--controller \"" + vm_disk_controller_model + "\" "; + if (is_virtualbox_version_newer(4, 3, 0)) { + command += "--controller \"" + vm_disk_controller_model + "\" "; + } else { + if ((vm_disk_controller_type == "sata") || (vm_disk_controller_type == "SATA")) { + command += "--controller \"IntelAHCI\" "; + } else { + command += "--controller \"" + vm_disk_controller_model + "\" "; + } + } command += "--hostiocache off "; if ((vm_disk_controller_type == "sata") || (vm_disk_controller_type == "SATA")) { if (is_virtualbox_version_newer(4, 3, 0)) {