Index: trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp	(revision 54579)
+++ trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp	(revision 54580)
@@ -22,4 +22,5 @@
 #include <iprt/cpp/autores.h>
 #include <iprt/buildconfig.h>
+#include <iprt/getopt.h>
 #include <iprt/initterm.h>
 #include <iprt/mem.h>
@@ -91,4 +92,5 @@
     WRITE_CORE_DUMP,
 #endif
+    WRITE_LOG,
     TAKE_SNAPSHOT,
     SAVE_STATE,
@@ -100,5 +102,5 @@
 };
 
-static void usage(enum VBoxControlUsage eWhich = USAGE_ALL)
+static RTEXITCODE usage(enum VBoxControlUsage eWhich = USAGE_ALL)
 {
     RTPrintf("Usage:\n\n");
@@ -148,4 +150,6 @@
         doUsage("", g_pszProgName, "writecoredump");
 #endif
+    if (eWhich == WRITE_LOG || eWhich == USAGE_ALL)
+        doUsage("", g_pszProgName, "writelog [--] <msg>");
     if (eWhich == TAKE_SNAPSHOT || eWhich == USAGE_ALL)
         doUsage("", g_pszProgName, "takesnapshot");
@@ -160,7 +164,22 @@
     if (eWhich == VERSION   || eWhich == USAGE_ALL)
         doUsage("", g_pszProgName, "version");
+
+    return RTEXITCODE_SUCCESS;
 }
 
 /** @} */
+
+
+/**
+ * Implementation of the '--version' option.
+ *
+ * @returns RTEXITCODE_SUCCESS
+ */
+static RTEXITCODE printVersion(void)
+{
+    RTPrintf("%sr%u\n", VBOX_VERSION_STRING, RTBldCfgRevision());
+    return RTEXITCODE_SUCCESS;
+}
+
 
 /**
@@ -173,4 +192,5 @@
 static RTEXITCODE VBoxControlError(const char *pszFormat, ...)
 {
+    /** @todo prefix with current command. */
     va_list va;
     va_start(va, pszFormat);
@@ -182,4 +202,18 @@
 
 /**
+ * Displays a getopt error.
+ *
+ * @returns RTEXITCODE_FAILURE.
+ * @param   ch          The RTGetOpt return value.
+ * @param   pValueUnion The RTGetOpt return data.
+ */
+static RTEXITCODE VBoxCtrlGetOptError(int ch, PCRTGETOPTUNION pValueUnion)
+{
+    /** @todo prefix with current command. */
+    return RTGetOptPrintError(ch, pValueUnion);
+}
+
+
+/**
  * Displays an syntax error message.
  *
@@ -190,4 +224,5 @@
 static RTEXITCODE VBoxControlSyntaxError(const char *pszFormat, ...)
 {
+    /** @todo prefix with current command. */
     va_list va;
     va_start(va, pszFormat);
@@ -1724,4 +1759,44 @@
 
 /**
+ * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: writelog}
+ */
+static RTEXITCODE handleWriteLog(int argc, char *argv[])
+{
+    static const RTGETOPTDEF s_aOptions[] =
+    {
+        { "--dummy", 'D', RTGETOPT_REQ_NOTHING }
+    };
+
+    RTGETOPTSTATE GetOptState;
+    int rc = RTGetOptInit(&GetOptState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions),
+                          0 /*iFirst*/, RTGETOPTINIT_FLAGS_OPTS_FIRST);
+    if (RT_SUCCESS(rc))
+    {
+        RTGETOPTUNION   ValueUnion;
+        int             ch;
+        while ((ch == RTGetOpt(&GetOptState, &ValueUnion)) != 0)
+        {
+            switch (ch)
+            {
+                case VINF_GETOPT_NOT_OPTION:
+                    rc = VbglR3WriteLog(ValueUnion.psz, strlen(ValueUnion.psz));
+                    if (RT_FAILURE(rc))
+                        return VBoxControlError("VbglR3WriteLog: %Rrc", rc);
+                    break;
+
+                case 'h': return usage(WRITE_LOG);
+                case 'V': return printVersion();
+                default:
+                    return VBoxCtrlGetOptError(ch, &ValueUnion);
+            }
+        }
+    }
+    else
+        return VBoxControlError("RTGetOptInit: %Rrc", rc);
+    return RTEXITCODE_SUCCESS;
+}
+
+
+/**
  * @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: takesnapshot}
  */
@@ -1766,6 +1841,5 @@
     if (argc)
         return VBoxControlSyntaxError("getversion does not take any arguments");
-    RTPrintf("%sr%u\n", VBOX_VERSION_STRING, RTBldCfgRevision());
-    return RTEXITCODE_SUCCESS;
+    return printVersion();
 }
 
@@ -1813,4 +1887,5 @@
     { "dpc",                    handleDpc },
 #endif
+    { "writelog",               handleWriteLog },
     { "takesnapshot",           handleTakeSnapshot },
     { "savestate",              handleSaveState },
@@ -1858,5 +1933,5 @@
         {
             /* Print version number, and do nothing else. */
-            RTPrintf("%sr%u\n", VBOX_VERSION_STRING, RTBldCfgRevision());
+            printVersion();
             fOnlyInfo = true;
             fShowLogo = false;
Index: trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp	(revision 54579)
+++ trunk/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp	(revision 54580)
@@ -200,2 +200,9 @@
 
 #endif
+
+VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cch)
+{
+    NOREF(pch); NOREF(cch);
+    return VINF_SUCCESS;
+}
+
