Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 39990)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 39991)
@@ -875,7 +875,15 @@
                 ULONG uRetExitCode, uRetFlags;
                 rc = pGuest->GetProcessStatus(uPID, &uRetExitCode, &uRetFlags, &retStatus);
-                if (SUCCEEDED(rc) && fVerbose)
-                    RTPrintf("Exit code=%u (Status=%u [%s], Flags=%u)\n", uRetExitCode, retStatus, ctrlExecProcessStatusToText(retStatus), uRetFlags);
-                rcProc = ctrlExecProcessStatusToExitCode(retStatus, uRetExitCode);
+                if (SUCCEEDED(rc))
+                {
+                    if (fVerbose)
+                        RTPrintf("Exit code=%u (Status=%u [%s], Flags=%u)\n", uRetExitCode, retStatus, ctrlExecProcessStatusToText(retStatus), uRetFlags);
+                    rcProc = ctrlExecProcessStatusToExitCode(retStatus, uRetExitCode);
+                }
+                else
+                {
+                    ctrlPrintError(pGuest, COM_IIDOF(IGuest));
+                    rcProc = RTEXITCODE_FAILURE;
+                }
             }
         }
Index: trunk/src/VBox/Main/include/GuestImpl.h
===================================================================
--- trunk/src/VBox/Main/include/GuestImpl.h	(revision 39990)
+++ trunk/src/VBox/Main/include/GuestImpl.h	(revision 39991)
@@ -248,5 +248,5 @@
     typedef std::map< uint32_t, VBOXGUESTCTRL_PROCESS >::const_iterator GuestProcessMapIterConst;
 
-    int  processGetStatus(uint32_t u32PID, PVBOXGUESTCTRL_PROCESS pProcess);
+    int  processGetStatus(uint32_t u32PID, PVBOXGUESTCTRL_PROCESS pProcess, bool fRemove);
     int  processSetStatus(uint32_t u32PID, ExecuteProcessStatus_T enmStatus, uint32_t uExitCode, uint32_t uFlags);
 
Index: trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 39990)
+++ trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 39991)
@@ -994,8 +994,12 @@
  *
  * @return  IPRT status code.
- * @param   u32PID
- * @param   pProcess
+ * @param   u32PID                  PID of process to get status for.
+ * @param   pProcess                Where to store the process information.
+ * @param   fRemove                 Flag indicating whether to remove the
+ *                                  process from the map when process marked a
+ *                                  exited/terminated.
  */
-int Guest::processGetStatus(uint32_t u32PID, PVBOXGUESTCTRL_PROCESS pProcess)
+int Guest::processGetStatus(uint32_t u32PID, PVBOXGUESTCTRL_PROCESS pProcess,
+                            bool fRemove)
 {
     AssertReturn(u32PID, VERR_INVALID_PARAMETER);
@@ -1015,6 +1019,9 @@
         /* If the is marked as stopped/terminated
          * remove it from the map. */
-        if (it->second.mStatus != ExecuteProcessStatus_Started)
+        if (   fRemove
+            && it->second.mStatus != ExecuteProcessStatus_Started)
+        {
             mGuestProcessMap.erase(it);
+        }
 
         return VINF_SUCCESS;
@@ -1861,5 +1868,5 @@
     {
         VBOXGUESTCTRL_PROCESS process;
-        int vrc = processGetStatus(aPID, &process);
+        int vrc = processGetStatus(aPID, &process, false /* Don't remove */);
         if (RT_SUCCESS(vrc))
         {
@@ -2065,5 +2072,5 @@
     {
         VBOXGUESTCTRL_PROCESS proc;
-        int vrc = processGetStatus(aPID, &proc);
+        int vrc = processGetStatus(aPID, &proc, false /* Don't remove */);
         if (RT_FAILURE(vrc))
         {
@@ -2234,5 +2241,6 @@
     {
         VBOXGUESTCTRL_PROCESS process;
-        int vrc = processGetStatus(aPID, &process);
+        int vrc = processGetStatus(aPID, &process,
+                                   true /* Remove when terminated */);
         if (RT_SUCCESS(vrc))
         {
