Index: /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 42786)
+++ /trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp	(revision 42787)
@@ -657,5 +657,5 @@
         {
             fSignal = (uWaitFlags & ProcessWaitForFlag_Start);
-            waitRes = ProcessWaitResult_Status;
+            waitRes = ProcessWaitResult_Start;
 
             mData.mStatus = ProcessStatus_Started;
@@ -714,6 +714,7 @@
         {
             fSignal = TRUE; /* Signal in any case. */
+            /* Do we need to report termination? */
             waitRes = (mData.mProcess.mFlags & ProcessCreateFlag_IgnoreOrphanedProcesses)
-                    ? ProcessWaitResult_Terminate : ProcessWaitResult_Status;
+                    ? ProcessWaitResult_Status : ProcessWaitResult_Terminate;
 
             mData.mStatus = ProcessStatus_Down;
@@ -886,5 +887,9 @@
 
     if (mData.mStatus != ProcessStatus_Started)
+    {
+        if (pcbRead)
+            *pcbRead = 0;
         return VINF_SUCCESS; /* Nothing to read anymore. */
+    }
 
     uint32_t uContextID = 0;
@@ -1244,20 +1249,4 @@
         || (fWaitFlags & ProcessWaitForFlag_StdErr))
     {
-        /* Filter out waits which are *not* supported using
-         * older guest control Guest Additions. */
-        AssertPtr(mData.mParent);
-        if (mData.mParent->getProtocolVersion() < 2)
-        {
-            /* We don't support waiting for stdin, out + err,
-             * just skip waiting then. */
-            if (   (fWaitFlags & ProcessWaitForFlag_StdIn)
-                || (fWaitFlags & ProcessWaitForFlag_StdOut)
-                || (fWaitFlags & ProcessWaitForFlag_StdErr))
-            {
-                /* Use _Any because we don't know what to tell the caller. */
-                waitRes.mResult = ProcessWaitResult_Any;
-            }
-        }
-
         switch (mData.mStatus)
         {
@@ -1281,7 +1270,27 @@
                 break;
 
+            case ProcessStatus_Started:
+            {
+                /* Filter out waits which are *not* supported using
+                 * older guest control Guest Additions. */
+                AssertPtr(mData.mParent);
+                if (mData.mParent->getProtocolVersion() < 2)
+                {
+                    /* We don't support waiting for stdin, out + err,
+                     * just skip waiting then. */
+                    if (   (fWaitFlags & ProcessWaitForFlag_StdIn)
+                        || (fWaitFlags & ProcessWaitForFlag_StdOut)
+                        || (fWaitFlags & ProcessWaitForFlag_StdErr))
+                    {
+                        /* Use _Any because we don't know what to tell the caller. */
+                        waitRes.mResult = ProcessWaitResult_Any;
+                    }
+                }
+
+                break;
+            }
+
             case ProcessStatus_Undefined:
             case ProcessStatus_Starting:
-            case ProcessStatus_Started:
                 /* Do the waiting below. */
                 break;
@@ -1518,4 +1527,6 @@
     }
 
+    LogFlowThisFunc(("readData returned %Rrc, cbRead=%RU64\n", vrc, cbRead));
+
     /** @todo Do setError() here. */
     HRESULT hr = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR;
@@ -1626,4 +1637,7 @@
     com::SafeArray<BYTE> data(ComSafeArrayInArg(aData));
     int vrc = writeData(aHandle, aFlags, data.raw(), data.size(), aTimeoutMS, (uint32_t*)aWritten);
+
+    LogFlowThisFunc(("writeData returned %Rrc, aWritten=%RU32\n", vrc, aWritten));
+
     /** @todo Do setError() here. */
     HRESULT hr = RT_SUCCESS(vrc) ? S_OK : VBOX_E_IPRT_ERROR;
Index: /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 42786)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 42787)
@@ -257,5 +257,6 @@
                                    30 * 1000 /* Timeout */, waitRes);
             if (   RT_FAILURE(rc)
-                || waitRes.mResult != ProcessWaitForFlag_StdIn)
+                || (   waitRes.mResult != ProcessWaitResult_StdIn
+                    && waitRes.mResult != ProcessWaitResult_Any))
             {
                 break;
