Index: /trunk/src/VBox/Main/include/ConsoleImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 75954)
+++ /trunk/src/VBox/Main/include/ConsoleImpl.h	(revision 75955)
@@ -291,7 +291,7 @@
      *
      * @returns COM status code.
-     * @þaram   strCfg    The config for the disks.
-     *
-     * @note: One line in the config string contains all required data for one disk.
+     * @param   strCfg    The config for the disks.
+     *
+     * @note  One line in the config string contains all required data for one disk.
      *        The format for one disk is some sort of comma separated value using
      *        key=value pairs.
@@ -302,4 +302,12 @@
      */
     HRESULT i_setDiskEncryptionKeys(const Utf8Str &strCfg);
+
+
+#ifdef VBOX_WITH_GUEST_PROPS
+    // VMMDev needs:
+    HRESULT                     i_pullGuestProperties(ComSafeArrayOut(BSTR, names), ComSafeArrayOut(BSTR, values),
+                                                      ComSafeArrayOut(LONG64, timestamps), ComSafeArrayOut(BSTR, flags));
+    static DECLCALLBACK(int)    i_doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
+#endif
 
 private:
@@ -739,5 +747,4 @@
                         bool fAttachDetach, bool fIgnoreConnectFailure);
     int i_configSerialPort(PCFGMNODE pInst, PortMode_T ePortMode, const char *pszPath, bool fServer);
-    static DECLCALLBACK(int) i_configGuestProperties(void *pvConsole);
     static DECLCALLBACK(void) i_vmstateChangeCallback(PUVM pUVM, VMSTATE enmState, VMSTATE enmOldState, void *pvUser);
     static DECLCALLBACK(int) i_unplugCpu(Console *pThis, PUVM pUVM, VMCPUID idCpu);
@@ -836,5 +843,4 @@
 
 #ifdef VBOX_WITH_GUEST_PROPS
-    static DECLCALLBACK(int)    i_doGuestPropNotification(void *pvExtension, uint32_t, void *pvParms, uint32_t cbParms);
     HRESULT                     i_doEnumerateGuestProperties(const Utf8Str &aPatterns,
                                                              std::vector<Utf8Str> &aNames,
Index: /trunk/src/VBox/Main/include/VMMDev.h
===================================================================
--- /trunk/src/VBox/Main/include/VMMDev.h	(revision 75954)
+++ /trunk/src/VBox/Main/include/VMMDev.h	(revision 75955)
@@ -59,9 +59,9 @@
     int hgcmLoadService (const char *pszServiceLibrary, const char *pszServiceName);
     int hgcmHostCall (const char *pszServiceName, uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms);
-#ifdef VBOX_WITH_CRHGSMI
+# ifdef VBOX_WITH_CRHGSMI
     int hgcmHostSvcHandleCreate (const char *pszServiceName, HGCMCVSHANDLE * phSvc);
     int hgcmHostSvcHandleDestroy (HGCMCVSHANDLE hSvc);
     int hgcmHostFastCallAsync (HGCMCVSHANDLE hSvc, uint32_t function, PVBOXHGCMSVCPARM pParm, PHGCMHOSTFASTCALLCB pfnCompletion, void *pvCompletion);
-#endif
+# endif
     void hgcmShutdown(bool fUvmIsInvalid = false);
 
@@ -70,4 +70,13 @@
 
 private:
+#ifdef VBOX_WITH_HGCM
+# ifdef VBOX_WITH_GUEST_PROPS
+    void i_guestPropSetMultiple(void *names, void *values, void *timestamps, void *flags);
+    void i_guestPropSet(const char *pszName, const char *pszValue, const char *pszFlags);
+    int  i_guestPropSetGlobalPropertyFlags(uint32_t fFlags);
+    int  i_guestPropLoadAndConfigure();
+# endif
+#endif
+
     static DECLCALLBACK(void *) drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
     static DECLCALLBACK(int)    drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 75954)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 75955)
@@ -835,4 +835,15 @@
 
 #ifdef VBOX_WITH_GUEST_PROPS
+
+/**
+ * Wrapper for VMMDev::i_guestPropertiesHandleVMReset
+ */
+HRESULT Console::i_pullGuestProperties(ComSafeArrayOut(BSTR, names), ComSafeArrayOut(BSTR, values),
+                                       ComSafeArrayOut(LONG64, timestamps), ComSafeArrayOut(BSTR, flags))
+{
+    AssertReturn(mControl.isNotNull(), VERR_INVALID_POINTER);
+    return mControl->PullGuestProperties(ComSafeArrayOutArg(names), ComSafeArrayOutArg(values),
+                                         ComSafeArrayOutArg(timestamps), ComSafeArrayOutArg(flags));
+}
 
 /**
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 75954)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 75955)
@@ -3185,11 +3185,4 @@
             }
         }
-#endif
-
-#ifdef VBOX_WITH_GUEST_PROPS
-        /*
-         * Guest property service.
-         */
-        rc = i_configGuestProperties(this);
 #endif
 
@@ -6000,228 +5993,2 @@
 }
 
-
-#ifdef VBOX_WITH_GUEST_PROPS
-
-/**
- * Set an array of guest properties
- */
-static void configSetProperties(VMMDev * const pVMMDev,
-                                void *names,
-                                void *values,
-                                void *timestamps,
-                                void *flags)
-{
-    VBOXHGCMSVCPARM parms[4];
-
-    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[0].u.pointer.addr = names;
-    parms[0].u.pointer.size = 0;  /* We don't actually care. */
-    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[1].u.pointer.addr = values;
-    parms[1].u.pointer.size = 0;  /* We don't actually care. */
-    parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[2].u.pointer.addr = timestamps;
-    parms[2].u.pointer.size = 0;  /* We don't actually care. */
-    parms[3].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[3].u.pointer.addr = flags;
-    parms[3].u.pointer.size = 0;  /* We don't actually care. */
-
-    pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROPS, 4, &parms[0]);
-}
-
-/**
- * Set a single guest property
- */
-static void configSetProperty(VMMDev * const pVMMDev,
-                              const char *pszName,
-                              const char *pszValue,
-                              const char *pszFlags)
-{
-    VBOXHGCMSVCPARM parms[4];
-
-    AssertPtrReturnVoid(pszName);
-    AssertPtrReturnVoid(pszValue);
-    AssertPtrReturnVoid(pszFlags);
-    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[0].u.pointer.addr = (void *)pszName;
-    parms[0].u.pointer.size = (uint32_t)strlen(pszName) + 1;
-    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[1].u.pointer.addr = (void *)pszValue;
-    parms[1].u.pointer.size = (uint32_t)strlen(pszValue) + 1;
-    parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
-    parms[2].u.pointer.addr = (void *)pszFlags;
-    parms[2].u.pointer.size = (uint32_t)strlen(pszFlags) + 1;
-    pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROP, 3, &parms[0]);
-}
-
-/**
- * Set the global flags value by calling the service
- * @returns the status returned by the call to the service
- *
- * @param   pTable  the service instance handle
- * @param   eFlags  the flags to set
- */
-int configSetGlobalPropertyFlags(VMMDev * const pVMMDev, uint32_t fFlags)
-{
-    VBOXHGCMSVCPARM parm;
-    HGCMSvcSetU32(&parm, fFlags);
-    int rc = pVMMDev->hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS, 1, &parm);
-    if (RT_FAILURE(rc))
-    {
-        char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
-        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags)))
-            Log(("Failed to set the global flags.\n"));
-        else
-            Log(("Failed to set the global flags \"%s\".\n", szFlags));
-    }
-    return rc;
-}
-
-#endif /* VBOX_WITH_GUEST_PROPS */
-
-/**
- * Set up the Guest Property service, populate it with properties read from
- * the machine XML and set a couple of initial properties.
- */
-/* static */ int Console::i_configGuestProperties(void *pvConsole)
-{
-#ifdef VBOX_WITH_GUEST_PROPS
-    AssertReturn(pvConsole, VERR_INVALID_POINTER);
-    ComObjPtr<Console> pConsole = static_cast<Console *>(pvConsole);
-    AssertReturn(pConsole->m_pVMMDev, VERR_INVALID_POINTER);
-
-    /* Load the service */
-    int rc = pConsole->m_pVMMDev->hgcmLoadService("VBoxGuestPropSvc", "VBoxGuestPropSvc");
-
-    if (RT_FAILURE(rc))
-    {
-        LogRel(("VBoxGuestPropSvc is not available. rc = %Rrc\n", rc));
-        /* That is not a fatal failure. */
-        rc = VINF_SUCCESS;
-    }
-    else
-    {
-        /*
-         * Initialize built-in properties that can be changed and saved.
-         *
-         * These are typically transient properties that the guest cannot
-         * change.
-         */
-
-        /* Sysprep execution by VBoxService. */
-        configSetProperty(pConsole->m_pVMMDev,
-                          "/VirtualBox/HostGuest/SysprepExec", "",
-                          "TRANSIENT, RDONLYGUEST");
-        configSetProperty(pConsole->m_pVMMDev,
-                          "/VirtualBox/HostGuest/SysprepArgs", "",
-                          "TRANSIENT, RDONLYGUEST");
-
-        /*
-         * Pull over the properties from the server.
-         */
-        SafeArray<BSTR> namesOut;
-        SafeArray<BSTR> valuesOut;
-        SafeArray<LONG64> timestampsOut;
-        SafeArray<BSTR> flagsOut;
-        HRESULT hrc;
-        hrc = pConsole->mControl->PullGuestProperties(ComSafeArrayAsOutParam(namesOut),
-                                                      ComSafeArrayAsOutParam(valuesOut),
-                                                      ComSafeArrayAsOutParam(timestampsOut),
-                                                      ComSafeArrayAsOutParam(flagsOut));
-        AssertLogRelMsgReturn(SUCCEEDED(hrc), ("hrc=%Rhrc\n", hrc), VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR);
-        size_t cProps = namesOut.size();
-        size_t cAlloc = cProps + 1;
-        if (   valuesOut.size() != cProps
-            || timestampsOut.size() != cProps
-            || flagsOut.size() != cProps
-           )
-            AssertFailedReturn(VERR_INVALID_PARAMETER);
-
-        char **papszNames, **papszValues, **papszFlags;
-        char szEmpty[] = "";
-        LONG64 *pai64Timestamps;
-        papszNames = (char **)RTMemTmpAllocZ(sizeof(void *) * cAlloc);
-        papszValues = (char **)RTMemTmpAllocZ(sizeof(void *) * cAlloc);
-        pai64Timestamps = (LONG64 *)RTMemTmpAllocZ(sizeof(LONG64) * cAlloc);
-        papszFlags = (char **)RTMemTmpAllocZ(sizeof(void *) * cAlloc);
-        if (papszNames && papszValues && pai64Timestamps && papszFlags)
-        {
-            for (unsigned i = 0; RT_SUCCESS(rc) && i < cProps; ++i)
-            {
-                AssertPtrBreakStmt(namesOut[i], rc = VERR_INVALID_PARAMETER);
-                rc = RTUtf16ToUtf8(namesOut[i], &papszNames[i]);
-                if (RT_FAILURE(rc))
-                    break;
-                if (valuesOut[i])
-                    rc = RTUtf16ToUtf8(valuesOut[i], &papszValues[i]);
-                else
-                    papszValues[i] = szEmpty;
-                if (RT_FAILURE(rc))
-                    break;
-                pai64Timestamps[i] = timestampsOut[i];
-                if (flagsOut[i])
-                    rc = RTUtf16ToUtf8(flagsOut[i], &papszFlags[i]);
-                else
-                    papszFlags[i] = szEmpty;
-            }
-            if (RT_SUCCESS(rc))
-                configSetProperties(pConsole->m_pVMMDev,
-                                    (void *)papszNames,
-                                    (void *)papszValues,
-                                    (void *)pai64Timestamps,
-                                    (void *)papszFlags);
-            for (unsigned i = 0; i < cProps; ++i)
-            {
-                RTStrFree(papszNames[i]);
-                if (valuesOut[i])
-                    RTStrFree(papszValues[i]);
-                if (flagsOut[i])
-                    RTStrFree(papszFlags[i]);
-            }
-        }
-        else
-            rc = VERR_NO_MEMORY;
-        RTMemTmpFree(papszNames);
-        RTMemTmpFree(papszValues);
-        RTMemTmpFree(pai64Timestamps);
-        RTMemTmpFree(papszFlags);
-        AssertRCReturn(rc, rc);
-
-        /*
-         * These properties have to be set before pulling over the properties
-         * from the machine XML, to ensure that properties saved in the XML
-         * will override them.
-         */
-        /* Set the raw VBox version string as a guest property. Used for host/guest
-         * version comparison. */
-        configSetProperty(pConsole->m_pVMMDev, "/VirtualBox/HostInfo/VBoxVer",
-                          VBOX_VERSION_STRING_RAW, "TRANSIENT, RDONLYGUEST");
-        /* Set the full VBox version string as a guest property. Can contain vendor-specific
-         * information/branding and/or pre-release tags. */
-        configSetProperty(pConsole->m_pVMMDev, "/VirtualBox/HostInfo/VBoxVerExt",
-                          VBOX_VERSION_STRING, "TRANSIENT, RDONLYGUEST");
-        /* Set the VBox SVN revision as a guest property */
-        configSetProperty(pConsole->m_pVMMDev, "/VirtualBox/HostInfo/VBoxRev",
-                          RTBldCfgRevisionStr(), "TRANSIENT, RDONLYGUEST");
-
-        /*
-         * Register the host notification callback
-         */
-        HGCMSVCEXTHANDLE hDummy;
-        HGCMHostRegisterServiceExtension(&hDummy, "VBoxGuestPropSvc",
-                                         Console::i_doGuestPropNotification,
-                                         pvConsole);
-
-#ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
-        rc = configSetGlobalPropertyFlags(pConsole->m_pVMMDev, GUEST_PROP_F_RDONLYGUEST);
-        AssertRCReturn(rc, rc);
-#endif
-
-        Log(("Set VBoxGuestPropSvc property store\n"));
-    }
-    return VINF_SUCCESS;
-#else /* !VBOX_WITH_GUEST_PROPS */
-    return VERR_NOT_SUPPORTED;
-#endif /* !VBOX_WITH_GUEST_PROPS */
-}
-
Index: /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 75954)
+++ /trunk/src/VBox/Main/src-client/VMMDevInterface.cpp	(revision 75955)
@@ -29,4 +29,5 @@
 #include <VBox/shflsvc.h>
 #include <iprt/asm.h>
+#include <iprt/buildconfig.h>
 
 #ifdef VBOX_WITH_HGCM
@@ -35,4 +36,7 @@
 # if defined(RT_OS_DARWIN) && defined(VBOX_WITH_CROGL)
 #  include <VBox/HostServices/VBoxCrOpenGLSvc.h>
+# endif
+# ifdef VBOX_WITH_GUEST_PROPS
+#  include <VBox/version.h>
 # endif
 #endif
@@ -79,6 +83,6 @@
 //
 VMMDev::VMMDev(Console *console)
-    : mpDrv(NULL),
-      mParent(console)
+    : mpDrv(NULL)
+    , mParent(console)
 {
     int rc = RTSemEventCreate(&mCredentialsEvent);
@@ -797,4 +801,196 @@
     }
 }
+
+#ifdef VBOX_WITH_GUEST_PROPS
+
+/**
+ * Set an array of guest properties
+ */
+void VMMDev::i_guestPropSetMultiple(void *names, void *values, void *timestamps, void *flags)
+{
+    VBOXHGCMSVCPARM parms[4];
+
+    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[0].u.pointer.addr = names;
+    parms[0].u.pointer.size = 0;  /* We don't actually care. */
+    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[1].u.pointer.addr = values;
+    parms[1].u.pointer.size = 0;  /* We don't actually care. */
+    parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[2].u.pointer.addr = timestamps;
+    parms[2].u.pointer.size = 0;  /* We don't actually care. */
+    parms[3].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[3].u.pointer.addr = flags;
+    parms[3].u.pointer.size = 0;  /* We don't actually care. */
+
+    hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROPS, 4, &parms[0]);
+}
+
+/**
+ * Set a single guest property
+ */
+void VMMDev::i_guestPropSet(const char *pszName, const char *pszValue, const char *pszFlags)
+{
+    VBOXHGCMSVCPARM parms[4];
+
+    AssertPtrReturnVoid(pszName);
+    AssertPtrReturnVoid(pszValue);
+    AssertPtrReturnVoid(pszFlags);
+    parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[0].u.pointer.addr = (void *)pszName;
+    parms[0].u.pointer.size = (uint32_t)strlen(pszName) + 1;
+    parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[1].u.pointer.addr = (void *)pszValue;
+    parms[1].u.pointer.size = (uint32_t)strlen(pszValue) + 1;
+    parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
+    parms[2].u.pointer.addr = (void *)pszFlags;
+    parms[2].u.pointer.size = (uint32_t)strlen(pszFlags) + 1;
+    hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_PROP, 3, &parms[0]);
+}
+
+/**
+ * Set the global flags value by calling the service
+ * @returns the status returned by the call to the service
+ *
+ * @param   pTable  the service instance handle
+ * @param   eFlags  the flags to set
+ */
+int VMMDev::i_guestPropSetGlobalPropertyFlags(uint32_t fFlags)
+{
+    VBOXHGCMSVCPARM parm;
+    HGCMSvcSetU32(&parm, fFlags);
+    int rc = hgcmHostCall("VBoxGuestPropSvc", GUEST_PROP_FN_HOST_SET_GLOBAL_FLAGS, 1, &parm);
+    if (RT_FAILURE(rc))
+    {
+        char szFlags[GUEST_PROP_MAX_FLAGS_LEN];
+        if (RT_FAILURE(GuestPropWriteFlags(fFlags, szFlags)))
+            Log(("Failed to set the global flags.\n"));
+        else
+            Log(("Failed to set the global flags \"%s\".\n", szFlags));
+    }
+    return rc;
+}
+
+
+/**
+ * Set up the Guest Property service, populate it with properties read from
+ * the machine XML and set a couple of initial properties.
+ */
+int VMMDev::i_guestPropLoadAndConfigure()
+{
+    Assert(mpDrv);
+    ComObjPtr<Console> ptrConsole = this->mParent;
+    AssertReturn(ptrConsole.isNotNull(), VERR_INVALID_POINTER);
+
+    /* Load the service */
+    int rc = hgcmLoadService("VBoxGuestPropSvc", "VBoxGuestPropSvc");
+    if (RT_FAILURE(rc))
+    {
+        LogRel(("VBoxGuestPropSvc is not available. rc = %Rrc\n", rc));
+        return VINF_SUCCESS; /* That is not a fatal failure. */
+    }
+    /*
+     * Initialize built-in properties that can be changed and saved.
+     *
+     * These are typically transient properties that the guest cannot
+     * change.
+     */
+
+    /* Sysprep execution by VBoxService. */
+    i_guestPropSet("/VirtualBox/HostGuest/SysprepExec", "", "TRANSIENT, RDONLYGUEST");
+    i_guestPropSet("/VirtualBox/HostGuest/SysprepArgs", "", "TRANSIENT, RDONLYGUEST");
+
+    /*
+     * Pull over the properties from the server.
+     */
+    SafeArray<BSTR>     namesOut;
+    SafeArray<BSTR>     valuesOut;
+    SafeArray<LONG64>   timestampsOut;
+    SafeArray<BSTR>     flagsOut;
+    HRESULT hrc = ptrConsole->i_pullGuestProperties(ComSafeArrayAsOutParam(namesOut),
+                                                    ComSafeArrayAsOutParam(valuesOut),
+                                                    ComSafeArrayAsOutParam(timestampsOut),
+                                                    ComSafeArrayAsOutParam(flagsOut));
+    AssertLogRelMsgReturn(SUCCEEDED(hrc), ("hrc=%Rhrc\n", hrc), VERR_MAIN_CONFIG_CONSTRUCTOR_COM_ERROR);
+    size_t const cProps = namesOut.size();
+    size_t const cAlloc = cProps + 1;
+    AssertLogRelReturn(valuesOut.size()     == cProps, VERR_INTERNAL_ERROR_2);
+    AssertLogRelReturn(timestampsOut.size() == cProps, VERR_INTERNAL_ERROR_3);
+    AssertLogRelReturn(flagsOut.size()      == cProps, VERR_INTERNAL_ERROR_4);
+
+    char    szEmpty[] = "";
+    char  **papszNames      = (char  **)RTMemTmpAllocZ(sizeof(char *) * cAlloc);
+    char  **papszValues     = (char  **)RTMemTmpAllocZ(sizeof(char *) * cAlloc);
+    LONG64 *pai64Timestamps = (LONG64 *)RTMemTmpAllocZ(sizeof(LONG64) * cAlloc);
+    char  **papszFlags      = (char  **)RTMemTmpAllocZ(sizeof(char *) * cAlloc);
+    if (papszNames && papszValues && pai64Timestamps && papszFlags)
+    {
+        for (unsigned i = 0; RT_SUCCESS(rc) && i < cProps; ++i)
+        {
+            AssertPtrBreakStmt(namesOut[i], rc = VERR_INVALID_PARAMETER);
+            rc = RTUtf16ToUtf8(namesOut[i], &papszNames[i]);
+            if (RT_FAILURE(rc))
+                break;
+            if (valuesOut[i])
+                rc = RTUtf16ToUtf8(valuesOut[i], &papszValues[i]);
+            else
+                papszValues[i] = szEmpty;
+            if (RT_FAILURE(rc))
+                break;
+            pai64Timestamps[i] = timestampsOut[i];
+            if (flagsOut[i])
+                rc = RTUtf16ToUtf8(flagsOut[i], &papszFlags[i]);
+            else
+                papszFlags[i] = szEmpty;
+        }
+        if (RT_SUCCESS(rc))
+            i_guestPropSetMultiple((void *)papszNames, (void *)papszValues, (void *)pai64Timestamps, (void *)papszFlags);
+        for (unsigned i = 0; i < cProps; ++i)
+        {
+            RTStrFree(papszNames[i]);
+            if (valuesOut[i])
+                RTStrFree(papszValues[i]);
+            if (flagsOut[i])
+                RTStrFree(papszFlags[i]);
+        }
+    }
+    else
+        rc = VERR_NO_MEMORY;
+    RTMemTmpFree(papszNames);
+    RTMemTmpFree(papszValues);
+    RTMemTmpFree(pai64Timestamps);
+    RTMemTmpFree(papszFlags);
+    AssertRCReturn(rc, rc);
+
+    /*
+     * These properties have to be set before pulling over the properties
+     * from the machine XML, to ensure that properties saved in the XML
+     * will override them.
+     */
+    /* Set the raw VBox version string as a guest property. Used for host/guest
+     * version comparison. */
+    i_guestPropSet("/VirtualBox/HostInfo/VBoxVer", VBOX_VERSION_STRING_RAW, "TRANSIENT, RDONLYGUEST");
+    /* Set the full VBox version string as a guest property. Can contain vendor-specific
+     * information/branding and/or pre-release tags. */
+    i_guestPropSet("/VirtualBox/HostInfo/VBoxVerExt", VBOX_VERSION_STRING, "TRANSIENT, RDONLYGUEST");
+    /* Set the VBox SVN revision as a guest property */
+    i_guestPropSet("/VirtualBox/HostInfo/VBoxRev", RTBldCfgRevisionStr(), "TRANSIENT, RDONLYGUEST");
+
+    /*
+     * Register the host notification callback
+     */
+    HGCMSVCEXTHANDLE hDummy;
+    HGCMHostRegisterServiceExtension(&hDummy, "VBoxGuestPropSvc", Console::i_doGuestPropNotification, ptrConsole.m_p);
+
+# ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
+    rc = i_guestPropSetGlobalPropertyFlags(GUEST_PROP_F_RDONLYGUEST);
+    AssertRCReturn(rc, rc);
+# endif
+
+    Log(("Set VBoxGuestPropSvc property store\n"));
+    return VINF_SUCCESS;
+}
+
+#endif /* VBOX_WITH_GUEST_PROPS */
 
 /**
@@ -905,5 +1101,5 @@
 
     /*
-     * Load and configure guest control service.
+     * Load and configure the guest control service.
      */
 # ifdef VBOX_WITH_GUEST_CONTROL
@@ -923,4 +1119,13 @@
         LogRel(("Warning!: Failed to load the Guest Control Service! %Rrc\n", rc));
 # endif /* VBOX_WITH_GUEST_CONTROL */
+
+
+    /*
+     * Load and configure the guest properties service.
+     */
+# ifdef VBOX_WITH_GUEST_PROPS
+    rc = pThis->pVMMDev->i_guestPropLoadAndConfigure();
+    AssertLogRelRCReturn(rc, rc);
+# endif
 
 
