Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 33917)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 33918)
@@ -1341,24 +1341,27 @@
                     InsertConfigInteger(pCfg, "PortCount", cPorts);
 
-                    /* Needed configuration values for the bios. */
-                    if (pBiosCfg)
+                    /* Needed configuration values for the bios, only first controller. */
+                    if (!BusMgr->hasPciDevice("ahci", 1))
                     {
-                        InsertConfigString(pBiosCfg, "SataHardDiskDevice", "ahci");
+                        if (pBiosCfg)
+                        {
+                            InsertConfigString(pBiosCfg, "SataHardDiskDevice", "ahci");
+                        }
+                        
+                        for (uint32_t j = 0; j < 4; ++j)
+                        {
+                            static const char * const s_apszConfig[4] =
+                                    { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" };
+                            static const char * const s_apszBiosConfig[4] =
+                                    { "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
+                            
+                            LONG lPortNumber = -1;
+                            hrc = ctrls[i]->GetIDEEmulationPort(j, &lPortNumber);               H();
+                            InsertConfigInteger(pCfg, s_apszConfig[j], lPortNumber);
+                            if (pBiosCfg)
+                                InsertConfigInteger(pBiosCfg, s_apszBiosConfig[j], lPortNumber);
+                        }
                     }
-
-                    for (uint32_t j = 0; j < 4; ++j)
-                    {
-                        static const char * const s_apszConfig[4] =
-                        { "PrimaryMaster", "PrimarySlave", "SecondaryMaster", "SecondarySlave" };
-                        static const char * const s_apszBiosConfig[4] =
-                        { "SataPrimaryMasterLUN", "SataPrimarySlaveLUN", "SataSecondaryMasterLUN", "SataSecondarySlaveLUN" };
-
-                        LONG lPortNumber = -1;
-                        hrc = ctrls[i]->GetIDEEmulationPort(j, &lPortNumber);               H();
-                        InsertConfigInteger(pCfg, s_apszConfig[j], lPortNumber);
-                        if (pBiosCfg)
-                            InsertConfigInteger(pBiosCfg, s_apszBiosConfig[j], lPortNumber);
-                    }
-
+                        
                     /* Attach the status driver */
                     InsertConfigNode(pCtlInst, "LUN#999", &pLunL0);
Index: /trunk/src/VBox/Main/include/BusAssignmentManager.h
===================================================================
--- /trunk/src/VBox/Main/include/BusAssignmentManager.h	(revision 33917)
+++ /trunk/src/VBox/Main/include/BusAssignmentManager.h	(revision 33918)
@@ -111,4 +111,9 @@
     }
     virtual bool findPciAddress(const char* pszDevName, int iInstance, PciBusAddress& Address);
+    virtual bool hasPciDevice(const char* pszDevName, int iInstance)
+    {
+        PciBusAddress Address;
+        return findPciAddress(pszDevName, iInstance, Address);
+    }
 };
 
