Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 42208)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 42209)
@@ -118,4 +118,5 @@
 /* Other VBox includes: */
 #include <iprt/asm.h>
+#include <iprt/ctype.h>
 #include <iprt/err.h>
 #include <iprt/param.h>
@@ -125,4 +126,5 @@
 #include <iprt/ldr.h>
 #include <iprt/system.h>
+#include <iprt/stream.h>
 
 #include <VBox/vd.h>
@@ -305,4 +307,5 @@
     , mVerString("1.0")
     , m3DAvailable(false)
+    , mSettingsPwSet(false)
 {
 }
@@ -4402,8 +4405,48 @@
                 vm_render_mode_str = qApp->argv() [i];
         }
+        else if (!::strcmp (arg, "--settingspw"))
+        {
+            if (++i < argc)
+            {
+                RTStrCopy(mSettingsPw, sizeof(mSettingsPw), qApp->argv() [i]);
+                mSettingsPwSet = true;
+            }
+        }
+        else if (!::strcmp (arg, "--settingspwfile"))
+        {
+            if (++i < argc)
+            {
+                size_t cbFile;
+                char *pszFile = qApp->argv() [i];
+                bool fStdIn = !::strcmp(pszFile, "stdin");
+                int vrc = VINF_SUCCESS;
+                PRTSTREAM pStrm;
+                if (!fStdIn)
+                    vrc = RTStrmOpen(pszFile, "r", &pStrm);
+                else
+                    pStrm = g_pStdIn;
+                if (RT_SUCCESS(vrc))
+                {
+                    vrc = RTStrmReadEx(pStrm, mSettingsPw, sizeof(mSettingsPw)-1, &cbFile);
+                    if (RT_SUCCESS(vrc))
+                    {
+                        if (cbFile >= sizeof(mSettingsPw)-1)
+                            continue;
+                        else
+                        {
+                            unsigned i;
+                            for (i = 0; i < cbFile && !RT_C_IS_CNTRL(mSettingsPw[i]); i++)
+                                ;
+                            mSettingsPw[i] = '\0';
+                            mSettingsPwSet = true;
+                        }
+                    }
+                    if (!fStdIn)
+                        RTStrmClose(pStrm);
+                }
+            }
+        }
         else if (!::strcmp (arg, "--no-startvm-errormsgbox"))
-        {
             mShowStartVMErrors = false;
-        }
         else if (!::strcmp(arg, "--disable-patm"))
             mDisablePatm = true;
@@ -4477,4 +4520,7 @@
         }
     }
+
+    if (mSettingsPwSet)
+        mVBox.SetSettingsSecret(mSettingsPw);
 
     if (bForceSeamless && !vmUuid.isEmpty())
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 42208)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 42209)
@@ -535,4 +535,7 @@
 #endif
 
+    char mSettingsPw[256];
+    bool mSettingsPwSet;
+
     friend VBoxGlobal &vboxGlobal();
 };
