Index: trunk/src/VBox/Main/include/GuestSessionImplTasks.h
===================================================================
--- trunk/src/VBox/Main/include/GuestSessionImplTasks.h	(revision 106141)
+++ trunk/src/VBox/Main/include/GuestSessionImplTasks.h	(revision 106142)
@@ -459,5 +459,5 @@
 
     int checkGuestAdditionsStatus(GuestSession *pSession, eOSType osType);
-    int waitForGuestSession(ComObjPtr<Guest> pGuest, eOSType osType);
+    int waitForGuestSession(ComObjPtr<Guest> pGuest, eOSType osType, ComObjPtr<GuestSession> &pNewSession);
 
     /** Files to handle. */
Index: trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 106141)
+++ trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 106142)
@@ -2752,4 +2752,12 @@
         && !fSilent)
     {
+        Utf8Str cmdLine;
+        for (size_t iArg = 0; iArg < procInfo.mArguments.size(); iArg++)
+        {
+            cmdLine.append(procInfo.mArguments.at(iArg));
+            if (iArg < procInfo.mArguments.size() - 1)
+                cmdLine.append(" ");
+        }
+
         switch (vrc)
         {
@@ -2761,5 +2769,5 @@
                 setUpdateErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR,
                                   Utf8StrFmt(tr("Running update file \"%s\" on guest failed with exit code %d"),
-                                             procInfo.mExecutable.c_str(), iExitCode));
+                                             cmdLine.c_str(), iExitCode));
                 break;
 
@@ -2767,5 +2775,5 @@
             case VERR_GSTCTL_GUEST_ERROR:
                 setUpdateErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR, tr("Running update file on guest failed"),
-                                  GuestErrorInfo(GuestErrorInfo::Type_Process, vrcGuest, procInfo.mExecutable.c_str()));
+                                  GuestErrorInfo(GuestErrorInfo::Type_Process, vrcGuest, cmdLine.c_str()));
                 break;
 
@@ -2778,6 +2786,6 @@
             default:
                 setUpdateErrorMsg(VBOX_E_GSTCTL_GUEST_ERROR,
-                                  Utf8StrFmt(tr("Error while running update file \"%s\" on guest: %Rrc"),
-                                             procInfo.mExecutable.c_str(), vrc));
+                                  Utf8StrFmt(tr("Error while running update command \"%s\" on guest: %Rrc"),
+                                             cmdLine.c_str(), vrc));
                 break;
         }
@@ -2806,4 +2814,5 @@
         /* Check if Guest Additions kernel modules were loaded. */
         GuestProcessStartupInfo procInfo;
+        procInfo.mName = "Kernel modules status check";
         procInfo.mFlags = ProcessCreateFlag_None;
         procInfo.mExecutable = Utf8Str("/bin/sh");;
@@ -2817,4 +2826,5 @@
             /* Replace the last argument with corresponding value and check
              * if Guest Additions user services were started. */
+            procInfo.mName = "User services status check";
             procInfo.mArguments.pop_back();
             procInfo.mArguments.push_back("status-user");
@@ -2838,10 +2848,14 @@
  * Helper function which waits until Guest Additions services started.
  *
+ * Newly created guest session needs to be closed by caller.
+ *
  * @returns 0 on success or VERR_TIMEOUT if guest services were not
  *          started on time.
- * @param   pGuest      Guest interface to use.
- * @param   osType      Guest type.
+ * @param   pGuest          Guest interface to use.
+ * @param   osType          Guest type.
+ * @param   pNewSession     Output parameter for newly established guest type.
  */
-int GuestSessionTaskUpdateAdditions::waitForGuestSession(ComObjPtr<Guest> pGuest, eOSType osType)
+int GuestSessionTaskUpdateAdditions::waitForGuestSession(ComObjPtr<Guest> pGuest, eOSType osType,
+                                                         ComObjPtr<GuestSession> &pNewSession)
 {
     int vrc                         = VERR_GSTCTL_GUEST_ERROR;
@@ -2855,18 +2869,17 @@
     do
     {
-        ComObjPtr<GuestSession> pSession;
         GuestCredentials        guestCreds;
         GuestSessionStartupInfo startupInfo;
 
-        startupInfo.mName           = "Guest Additions connection checker";
+        startupInfo.mName           = "Guest Additions connection check";
         startupInfo.mOpenTimeoutMS  = 100;
 
-        vrc = pGuest->i_sessionCreate(startupInfo, guestCreds, pSession);
+        vrc = pGuest->i_sessionCreate(startupInfo, guestCreds, pNewSession);
         if (RT_SUCCESS(vrc))
         {
-            Assert(!pSession.isNull());
+            Assert(!pNewSession.isNull());
 
             int vrcGuest = VERR_GSTCTL_GUEST_ERROR; /* unused. */
-            vrc = pSession->i_startSession(&vrcGuest);
+            vrc = pNewSession->i_startSession(&vrcGuest);
             if (RT_SUCCESS(vrc))
             {
@@ -2874,9 +2887,9 @@
                 GuestSessionWaitResult_T enmWaitResult = GuestSessionWaitResult_None;
                 int vrcGuest2 = VINF_SUCCESS; /* unused. */
-                vrc = pSession->i_waitFor(GuestSessionWaitForFlag_Start, 100 /* timeout, ms */, enmWaitResult, &vrcGuest2);
+                vrc = pNewSession->i_waitFor(GuestSessionWaitForFlag_Start, 100 /* timeout, ms */, enmWaitResult, &vrcGuest2);
                 if (RT_SUCCESS(vrc))
                 {
                     /* Make sure Guest Additions were reloaded on the guest side. */
-                    vrc = checkGuestAdditionsStatus(pSession, osType);
+                    vrc = checkGuestAdditionsStatus(pNewSession, osType);
                     if (RT_SUCCESS(vrc))
                         LogRel(("Guest Additions Update: Guest Additions were successfully reloaded after installation\n"));
@@ -2884,5 +2897,4 @@
                         LogRel(("Guest Additions Update: Guest Additions were failed to reload after installation, please consider rebooting the guest\n"));
 
-                    vrc = pSession->Close();
                     vrcRet = VINF_SUCCESS;
                     break;
@@ -2890,5 +2902,5 @@
             }
 
-            vrc = pSession->Close();
+            vrc = pNewSession->Close();
         }
 
@@ -3364,9 +3376,18 @@
                         if (pSession->i_isTerminated())
                         {
+                            ComObjPtr<GuestSession> pNewSession;
+
                             LogRel(("Guest Additions Update: Old guest session has terminated, waiting updated guest services to start\n"));
 
                             /* Wait for VBoxService to restart. */
-                            vrc = waitForGuestSession(pSession->i_getParent(), osType);
-                            if (RT_FAILURE(vrc))
+                            vrc = waitForGuestSession(pSession->i_getParent(), osType, pNewSession);
+                            if (RT_SUCCESS(vrc))
+                            {
+                                hrc = pNewSession->i_directoryRemove(strUpdateDir, DIRREMOVEREC_FLAG_RECURSIVE | DIRREMOVEREC_FLAG_CONTENT_AND_DIR, &vrc);
+                                LogRel(("Cleanup Guest Additions update directory '%s', hrc=%Rrc, vrc=%Rrc\n",
+                                        strUpdateDir.c_str(), hrc, vrc));
+                                pNewSession->Close();
+                            }
+                            else
                                 hrc = setUpdateErrorMsg(VBOX_E_IPRT_ERROR,
                                                         Utf8StrFmt(tr("Guest services were not restarted, please reinstall Guest Additions manually")));
