Index: /trunk/doc/manual/en_US/SDKRef.xml
===================================================================
--- /trunk/doc/manual/en_US/SDKRef.xml	(revision 46523)
+++ /trunk/doc/manual/en_US/SDKRef.xml	(revision 46524)
@@ -3644,4 +3644,12 @@
             the host.</para>
         </listitem>
+
+        <listitem>
+          <para>The parameter list for <xref
+          linkend="IGuest__updateGuestAdditions"
+          xreflabel="IMedium::updateGuestAdditions()" /> was modified.</para>
+          It now supports specifying optional command line arguments for the
+          Guest Additions installer performing the actual update on the guest.
+        </listitem>
       </itemizedlist>
     </sect1>
Index: /trunk/doc/manual/en_US/user_VBoxManage.xml
===================================================================
--- /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 46523)
+++ /trunk/doc/manual/en_US/user_VBoxManage.xml	(revision 46524)
@@ -3216,5 +3216,5 @@
           <screen>VBoxManage guestcontrol &lt;vmname&gt;|&lt;uuid&gt; updateadditions
             [--source "&lt;guest additions .ISO file to use&gt;"] [--verbose]
-            [--wait-start]</screen>
+            [--wait-start] [-- [&lt;argument1&gt;] ... [&lt;argumentN&gt;]]</screen>
 
           <para>where the parameters mean: <glosslist>
@@ -3254,4 +3254,16 @@
                   <para>When omitting this flag VBoxManage will wait for the
                     whole Guest Additions update to complete.</para>
+                </glossdef>
+              </glossentry>
+
+              <glossentry>
+                <glossterm>[-- [&lt;argument1s&gt;] ... [&lt;argumentNs&gt;]]</glossterm>
+
+                <glossdef>
+                  <para>Optional command line arguments to use for the Guest Additions
+                  installer. Useful for retrofitting features which weren't installed
+                  before on the guest.</para>
+                  <para>Arguments containing spaces must be enclosed in
+                  quotation marks.</para>
                 </glossdef>
               </glossentry>
Index: /trunk/doc/manual/user_ChangeLogImpl.xml
===================================================================
--- /trunk/doc/manual/user_ChangeLogImpl.xml	(revision 46523)
+++ /trunk/doc/manual/user_ChangeLogImpl.xml	(revision 46524)
@@ -38,4 +38,9 @@
           media, and support the <computeroutput>--long</computeroutput>
           option to show really all available details</para>
+      </listitem>
+
+      <listitem>
+        <para>VBoxManage: added support for optional command line parameters for
+          the automatic Guest Additions update.</para>
       </listitem>
 
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 46523)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 46524)
@@ -261,4 +261,5 @@
                  "                            [--source <guest additions .ISO>] [--verbose]\n"
                  "                            [--wait-start]\n"
+                 "                            [-- [<argument1>] ... [<argumentN>]]\n"
                  "\n", pcszSep1, pcszSep2);
 }
@@ -633,6 +634,6 @@
     com::SafeArray<ProcessCreateFlag_T>  aCreateFlags;
     com::SafeArray<ProcessWaitForFlag_T> aWaitFlags;
-    com::SafeArray<IN_BSTR>              args;
-    com::SafeArray<IN_BSTR>              env;
+    com::SafeArray<IN_BSTR>              aArgs;
+    com::SafeArray<IN_BSTR>              aEnv;
     Utf8Str                              strUsername;
     Utf8Str                              strPassword;
@@ -669,5 +670,5 @@
                     return errorSyntax(USAGE_GUESTCONTROL, "Failed to parse environment value, rc=%Rrc", vrc);
                 for (int j = 0; j < cArgs; j++)
-                    env.push_back(Bstr(papszArg[j]).raw());
+                    aEnv.push_back(Bstr(papszArg[j]).raw());
 
                 RTGetOptArgvFree(papszArg);
@@ -742,8 +743,8 @@
             case VINF_GETOPT_NOT_OPTION:
             {
-                if (args.size() == 0 && strCmd.isEmpty())
+                if (aArgs.size() == 0 && strCmd.isEmpty())
                     strCmd = ValueUnion.psz;
                 else
-                    args.push_back(Bstr(ValueUnion.psz).raw());
+                    aArgs.push_back(Bstr(ValueUnion.psz).raw());
                 break;
             }
@@ -837,6 +838,6 @@
         ComPtr<IGuestProcess> pProcess;
         rc = pGuestSession->ProcessCreate(Bstr(strCmd).raw(),
-                                          ComSafeArrayAsInParam(args),
-                                          ComSafeArrayAsInParam(env),
+                                          ComSafeArrayAsInParam(aArgs),
+                                          ComSafeArrayAsInParam(aEnv),
                                           ComSafeArrayAsInParam(aCreateFlags),
                                           cMsTimeout,
@@ -2652,4 +2653,5 @@
      */
     Utf8Str strSource;
+    com::SafeArray<IN_BSTR> aArgs;
     bool fVerbose = false;
     bool fWaitStartOnly = false;
@@ -2684,4 +2686,13 @@
                 fWaitStartOnly = true;
                 break;
+
+            case VINF_GETOPT_NOT_OPTION:
+            {
+                if (aArgs.size() == 0 && strSource.isEmpty())
+                    strSource = ValueUnion.psz;
+                else
+                    aArgs.push_back(Bstr(ValueUnion.psz).raw());
+                break;
+            }
 
             default:
@@ -2731,4 +2742,5 @@
         ComPtr<IProgress> pProgress;
         CHECK_ERROR(guest, UpdateGuestAdditions(Bstr(strSource).raw(),
+                                                ComSafeArrayAsInParam(aArgs),
                                                 /* Wait for whole update process to complete. */
                                                 ComSafeArrayAsInParam(aUpdateFlags),
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 46523)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 46524)
@@ -490,6 +490,8 @@
 #else
     CGuest guest = session().GetConsole().GetGuest();
-    QVector<KAdditionsUpdateFlag> flagsUpdate;
-    CProgress progressInstall = guest.UpdateGuestAdditions(strSource, flagsUpdate);
+    QVector<KAdditionsUpdateFlag> aFlagsUpdate;
+    QVector<QString> aArgs;
+    CProgress progressInstall = guest.UpdateGuestAdditions(strSource,
+                                                           aArgs, aFlagsUpdate);
     bool fResult = guest.isOk();
     if (fResult)
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 46523)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 46524)
@@ -8582,5 +8582,5 @@
     <attribute name="loggingLevel" type="wstring">
       <desc>
-        Specifies the logging level in current use by VirtualBox. 
+        Specifies the logging level in current use by VirtualBox.
       </desc>
     </attribute>
@@ -11206,5 +11206,5 @@
   <interface
     name="IGuest" extends="$unknown"
-    uuid="19c32350-0618-4ede-b0c3-2b4311bf0d9b"
+    uuid="1a1969c1-a583-4975-9810-1dd0f0e3a8ae"
     wsmap="managed"
     >
@@ -11699,5 +11699,12 @@
       <param name="source" type="wstring" dir="in">
         <desc>
-          Path to the Guest Additions .ISO file to use for the upate.
+          Path to the Guest Additions .ISO file to use for the update.
+        </desc>
+      </param>
+      <param name="arguments" type="wstring" dir="in" safearray="yes">
+        <desc>
+          Optional command line arguments to use for the Guest Additions
+          installer. Useful for retrofitting features which weren't installed
+          before on the guest.
         </desc>
       </param>
@@ -20355,5 +20362,5 @@
     </desc>
   </interface>
-  
+
   <interface
     name="IVideoCaptureChangedEvent" extends="IEvent"
Index: /trunk/src/VBox/Main/include/GuestImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestImpl.h	(revision 46523)
+++ /trunk/src/VBox/Main/include/GuestImpl.h	(revision 46524)
@@ -109,5 +109,5 @@
                                      ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, ULONG *aMemCache,
                                      ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
-    STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress);
+    STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress);
 
 public:
Index: /trunk/src/VBox/Main/include/GuestSessionImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 46523)
+++ /trunk/src/VBox/Main/include/GuestSessionImpl.h	(revision 46524)
@@ -159,5 +159,6 @@
 
     SessionTaskUpdateAdditions(GuestSession *pSession,
-                               const Utf8Str &strSource, uint32_t uFlags);
+                               const Utf8Str &strSource, const ProcessArguments &aArguments,
+                               uint32_t uFlags);
 
     virtual ~SessionTaskUpdateAdditions(void);
@@ -220,4 +221,6 @@
     };
 
+    int addProcessArguments(ProcessArguments &aArgumentsDest,
+                            const ProcessArguments &aArgumentsSource);
     int copyFileToGuest(GuestSession *pSession, PRTISOFSFILE pISO,
                         Utf8Str const &strFileSource, const Utf8Str &strFileDest,
@@ -230,4 +233,6 @@
      *  which will be used for the updating process. */
     Utf8Str                    mSource;
+    /** (Optional) installer command line arguments. */
+    ProcessArguments           mArguments;
     /** Update flags. */
     uint32_t                   mFlags;
Index: /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 46523)
+++ /trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp	(revision 46524)
@@ -115,5 +115,6 @@
 #endif /* VBOX_WITH_GUEST_CONTROL */
 
-STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress)
+STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR aSource, ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags),
+                                         ComSafeArrayIn(IN_BSTR, aArguments), IProgress **aProgress)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -139,4 +140,21 @@
         if (!(fFlags & AdditionsUpdateFlag_WaitForUpdateStartOnly))
             return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), aFlags);
+    }
+
+    int rc = VINF_SUCCESS;
+
+    ProcessArguments aArgs;
+    if (aArguments)
+    {
+        try
+        {
+            com::SafeArray<IN_BSTR> arguments(ComSafeArrayInArg(aArguments));
+            for (size_t i = 0; i < arguments.size(); i++)
+                aArgs.push_back(Utf8Str(arguments[i]));
+        }
+        catch(std::bad_alloc &)
+        {
+            rc = VERR_NO_MEMORY;
+        }
     }
 
@@ -154,5 +172,6 @@
 
     ComObjPtr<GuestSession> pSession;
-    int rc = sessionCreate(startupInfo, guestCreds, pSession);
+    if (RT_SUCCESS(rc))
+        rc = sessionCreate(startupInfo, guestCreds, pSession);
     if (RT_FAILURE(rc))
     {
@@ -188,5 +207,5 @@
                 ComObjPtr<Progress> pProgress;
                 SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */,
-                                                                                   Utf8Str(aSource), fFlags);
+                                                                                   Utf8Str(aSource), aArgs, fFlags);
                 rc = pSession->startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress);
                 if (RT_SUCCESS(rc))
Index: /trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 46523)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp	(revision 46524)
@@ -840,8 +840,11 @@
 
 SessionTaskUpdateAdditions::SessionTaskUpdateAdditions(GuestSession *pSession,
-                                                       const Utf8Str &strSource, uint32_t uFlags)
+                                                       const Utf8Str &strSource,
+                                                       const ProcessArguments &aArguments,
+                                                       uint32_t uFlags)
                                                        : GuestSessionTask(pSession)
 {
     mSource = strSource;
+    mArguments = aArguments;
     mFlags  = uFlags;
 }
@@ -850,4 +853,43 @@
 {
 
+}
+
+int SessionTaskUpdateAdditions::addProcessArguments(ProcessArguments &aArgumentsDest,
+                                                    const ProcessArguments &aArgumentsSource)
+{
+    int rc = VINF_SUCCESS;
+
+    try
+    {
+        /* Filter out arguments which already are in the destination to
+         * not end up having them specified twice. Not the fastest method on the
+         * planet but does the job. */
+        ProcessArguments::const_iterator itSource = aArgumentsSource.begin();
+        while (itSource != aArgumentsSource.end())
+        {
+            bool fFound = false;
+            ProcessArguments::iterator itDest = aArgumentsDest.begin();
+            while (itDest != aArgumentsDest.end())
+            {
+                if ((*itDest).equalsIgnoreCase((*itSource)))
+                {
+                    fFound = true;
+                    break;
+                }
+                itDest++;
+            }
+
+            if (!fFound)
+                aArgumentsDest.push_back((*itSource));
+
+            itSource++;
+        }
+    }
+    catch(std::bad_alloc &)
+    {
+        return VERR_NO_MEMORY;
+    }
+
+    return rc;
 }
 
@@ -1331,4 +1373,8 @@
                          * Windows taskbar. */
                         siInstaller.mArguments.push_back(Utf8Str("/post_installstatus"));
+                        /* Add optional installer command line arguments from the API to the
+                         * installer's startup info. */
+                        rc = addProcessArguments(siInstaller.mArguments, mArguments);
+                        AssertRC(rc);
                         /* If the caller does not want to wait for out guest update process to end,
                          * complete the progress object now so that the caller can do other work. */
