Index: /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h	(revision 49947)
+++ /trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h	(revision 49948)
@@ -150,4 +150,5 @@
      *  a certin VBoxService tool's guest stream block. */
     int FromLs(const GuestProcessStreamBlock &strmBlk);
+    int FromMkTemp(const GuestProcessStreamBlock &strmBlk);
     int FromStat(const GuestProcessStreamBlock &strmBlk);
 
@@ -285,4 +286,6 @@
     size_t GetCount(void) const;
 
+    int GetRc(void) const;
+
     const char* GetString(const char *pszKey) const;
 
Index: /trunk/src/VBox/Main/include/GuestSessionImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 49947)
+++ /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 49948)
@@ -343,5 +343,5 @@
     int                     directoryRemoveInternal(const Utf8Str &strPath, uint32_t uFlags, int *pGuestRc);
     int                     directoryCreateInternal(const Utf8Str &strPath, uint32_t uMode, uint32_t uFlags, int *pGuestRc);
-    int                     objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, const Utf8Str &strName, int *pGuestRc);
+    int                     objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath, bool fDirectory, Utf8Str &strName, int *pGuestRc);
     int                     directoryOpenInternal(const GuestDirectoryOpenInfo &openInfo, ComObjPtr<GuestDirectory> &pDirectory, int *pGuestRc);
     int                     directoryQueryInfoInternal(const Utf8Str &strPath, GuestFsObjData &objData, int *pGuestRc);
Index: /trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 49947)
+++ /trunk/src/VBox/Main/src-client/GuestCtrlPrivate.cpp	(revision 49948)
@@ -317,4 +317,30 @@
         if (RT_FAILURE(rc)) throw rc;
         /** @todo Add complete ls info! */
+    }
+    catch (int rc2)
+    {
+        rc = rc2;
+    }
+
+    LogFlowFuncLeaveRC(rc);
+    return rc;
+}
+
+int GuestFsObjData::FromMkTemp(const GuestProcessStreamBlock &strmBlk)
+{
+    LogFlowFunc(("\n"));
+
+    int rc;
+
+    try
+    {
+#ifdef DEBUG
+        strmBlk.DumpToLog();
+#endif
+        /* Object name. */
+        mName = strmBlk.GetString("name");
+        if (mName.isEmpty()) throw VERR_NOT_FOUND;
+        /* Assign the stream block's rc. */
+        rc = strmBlk.GetRc();
     }
     catch (int rc2)
@@ -466,4 +492,19 @@
 
 /**
+ * Gets the return code (name = "rc") of this stream block.
+ *
+ * @return  IPRT status code.
+ */
+int GuestProcessStreamBlock::GetRc(void) const
+{
+    const char *pszValue = GetString("rc");
+    if (pszValue)
+    {
+        return RTStrToInt16(pszValue);
+    }
+    return VERR_NOT_FOUND;
+}
+
+/**
  * Returns a string value of a specified key.
  *
Index: /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 49947)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 49948)
@@ -866,8 +866,8 @@
 
 int GuestSession::objectCreateTempInternal(const Utf8Str &strTemplate, const Utf8Str &strPath,
-                                           bool fDirectory, const Utf8Str &strName, int *pGuestRc)
-{
-    LogFlowThisFunc(("strTemplate=%s, strPath=%s, fDirectory=%RTbool, strName=%s\n",
-                     strTemplate.c_str(), strPath.c_str(), fDirectory, strName.c_str()));
+                                           bool fDirectory, Utf8Str &strName, int *pGuestRc)
+{
+    LogFlowThisFunc(("strTemplate=%s, strPath=%s, fDirectory=%RTbool\n",
+                     strTemplate.c_str(), strPath.c_str(), fDirectory));
 
     int vrc = VINF_SUCCESS;
@@ -894,6 +894,33 @@
     }
 
+    /** @todo Use an internal HGCM command for this operation, since
+     *        we now can run in a user-dedicated session. */
+    int guestRc; GuestCtrlStreamObjects stdOut;
     if (RT_SUCCESS(vrc))
-        vrc = GuestProcessTool::Run(this, procInfo, pGuestRc);
+        vrc = GuestProcessTool::RunEx(this, procInfo,
+                                      &stdOut, 1 /* cStrmOutObjects */,
+                                      &guestRc);
+    if (   RT_SUCCESS(vrc)
+        && RT_SUCCESS(guestRc))
+    {
+        GuestFsObjData objData;
+        if (!stdOut.empty())
+        {
+            vrc = objData.FromMkTemp(stdOut.at(0));
+            if (RT_FAILURE(vrc))
+            {
+                guestRc = vrc;
+                vrc = VERR_GSTCTL_GUEST_ERROR;
+            }
+        }
+        else
+            vrc = VERR_NO_DATA;
+
+        if (RT_SUCCESS(vrc))
+            strName = objData.mName;
+    }
+
+    if (pGuestRc)
+        *pGuestRc = guestRc;
 
     LogFlowFuncLeaveRC(vrc);
