Index: /trunk/src/VBox/Main/src-server/generic/AutostartDb-generic.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/generic/AutostartDb-generic.cpp	(revision 42180)
+++ /trunk/src/VBox/Main/src-server/generic/AutostartDb-generic.cpp	(revision 42181)
@@ -27,7 +27,4 @@
 #include "AutostartDb.h"
 
-/** @todo: Make configurable through kmk/installer. */
-#define AUTOSTART_DATABASE "/etc/vbox/autostart.d"
-
 #if defined(RT_OS_LINUX)
 /**
@@ -38,8 +35,12 @@
  * @param   fAddVM        Flag whether a VM is added or removed from the database.
  */
-static int autostartModifyDb(bool fAutostart, bool fAddVM)
+int AutostartDb::autostartModifyDb(bool fAutostart, bool fAddVM)
 {
     int rc = VINF_SUCCESS;
     char *pszUser = NULL;
+
+    /* Check if the path is set. */
+    if (!m_pszAutostartDbPath)
+        return VERR_PATH_NOT_FOUND;
 
     rc = RTProcQueryUsernameA(RTProcSelf(), &pszUser);
@@ -58,5 +59,5 @@
 
         rc = RTStrAPrintf(&pszFile, "%s/%s.%s",
-                          AUTOSTART_DATABASE, pszUser, fAutostart ? "start" : "stop");
+                          m_pszAutostartDbPath, pszUser, fAutostart ? "start" : "stop");
         if (RT_SUCCESS(rc))
         {
@@ -141,4 +142,5 @@
     int rc = RTCritSectInit(&this->CritSect);
     NOREF(rc);
+    m_pszAutostartDbPath = NULL;
 #endif
 }
@@ -148,4 +150,31 @@
 #ifdef RT_OS_LINUX
     RTCritSectDelete(&this->CritSect);
+    if (m_pszAutostartDbPath)
+        RTStrFree(m_pszAutostartDbPath);
+#endif
+}
+
+int AutostartDb::setAutostartDbPath(const char *pszAutostartDbPathNew)
+{
+#if defined(RT_OS_LINUX)
+    char *pszAutostartDbPathTmp = NULL;
+
+    if (pszAutostartDbPathNew)
+    {
+        pszAutostartDbPathTmp = RTStrDup(pszAutostartDbPathNew);
+        if (!pszAutostartDbPathTmp)
+            return VERR_NO_MEMORY;
+    }
+
+    RTCritSectEnter(&this->CritSect);
+    if (m_pszAutostartDbPath)
+        RTStrFree(m_pszAutostartDbPath);
+
+    m_pszAutostartDbPath = pszAutostartDbPathTmp;
+    RTCritSectLeave(&this->CritSect);
+    return VINF_SUCCESS;
+#else
+    NOREF(pszAutostartDbPathNew);
+    return VERR_NOT_SUPPORTED
 #endif
 }
