Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 33862)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp	(revision 33863)
@@ -23,8 +23,10 @@
 
 #include <iprt/assert.h>
+#include <iprt/dir.h>
 #include <iprt/file.h>
 #include <iprt/getopt.h>
 #include <iprt/list.h>
 #include <iprt/mem.h>
+#include <iprt/path.h>
 #include <iprt/string.h>
 #include <iprt/stream.h>
@@ -81,5 +83,5 @@
         rc = RTFileFromNative(&hInput, RTFILE_NATIVE_STDIN);
         if (RT_FAILURE(rc))
-            VBoxServiceError("Cat: Could not translate input file to native handle, rc=%Rrc\n", rc);
+            VBoxServiceError("cat: Could not translate input file to native handle, rc=%Rrc\n", rc);
     }
 
@@ -88,5 +90,5 @@
         rc = RTFileFromNative(&hOutput, RTFILE_NATIVE_STDOUT);
         if (RT_FAILURE(rc))
-            VBoxServiceError("Cat: Could not translate output file to native handle, rc=%Rrc\n", rc);
+            VBoxServiceError("cat: Could not translate output file to native handle, rc=%Rrc\n", rc);
     }
 
@@ -126,4 +128,83 @@
  * @param   argv
  */
+int VBoxServiceToolboxMkDir(int argc, char **argv)
+{
+     static const RTGETOPTDEF s_aOptions[] =
+     {
+         { "--mode",     'm', RTGETOPT_REQ_STRING },
+         { "--parents",  'p', RTGETOPT_REQ_NOTHING },
+         { "--verbose",  'v', RTGETOPT_REQ_NOTHING }
+     };
+
+     int ch;
+     RTGETOPTUNION ValueUnion;
+     RTGETOPTSTATE GetState;
+     RTGetOptInit(&GetState, argc, argv, s_aOptions, RT_ELEMENTS(s_aOptions), 1, 0);
+
+     int rc = VINF_SUCCESS;
+     bool fMakeParentDirs = false;
+     bool fVerbose = false;
+
+     char *pszDir = NULL;
+     RTFMODE fMode = 0; /** @todo Get standard mode from umask? */
+
+     while (   (ch = RTGetOpt(&GetState, &ValueUnion))
+            && RT_SUCCESS(rc))
+     {
+         /* For options that require an argument, ValueUnion has received the value. */
+         switch (ch)
+         {
+             case 'p':
+                 fMakeParentDirs = true;
+                 break;
+
+             case 'm':
+                 /* Ignore by now. */
+                 break;
+
+             case 'v':
+                 fVerbose = true;
+                 break;
+
+             case VINF_GETOPT_NOT_OPTION:
+             {
+                 pszDir = RTPathAbsDup(ValueUnion.psz);
+                 if (!pszDir)
+                     rc = VERR_NO_MEMORY;
+                 break;
+             }
+
+             default:
+                 return RTGetOptPrintError(ch, &ValueUnion);
+         }
+     }
+
+     if (RT_SUCCESS(rc))
+     {
+         rc = fMakeParentDirs ?
+                RTDirCreateFullPath(pszDir, fMode)
+              : RTDirCreate(pszDir, fMode);
+
+         if (RT_SUCCESS(rc) && fVerbose)
+             VBoxServiceVerbose(0, "mkdir: Created directory '%s'\n", pszDir);
+         else if (RT_FAILURE(rc)) /** @todo Add a switch with more helpful error texts! */
+            VBoxServiceError("mkdir: Could not create directory, rc=%Rrc\n", rc);
+     }
+     else
+         VBoxServiceError("mkdir: Failed with rc=%Rrc\n", rc);
+     if (pszDir)
+         RTStrFree(pszDir);
+     return rc;
+}
+
+
+/**
+ *
+ *
+ * @return  int
+ *
+ * @param   argc
+ * @param   argv
+ */
 int VBoxServiceToolboxCat(int argc, char **argv)
 {
@@ -156,5 +237,5 @@
                                  RTFILE_O_DENY_WRITE);
                  if (RT_FAILURE(rc))
-                     VBoxServiceError("Cat: Could not create output file \"%s\"! rc=%Rrc\n",
+                     VBoxServiceError("cat: Could not create output file \"%s\"! rc=%Rrc\n",
                                       ValueUnion.psz, rc);
                  break;
@@ -166,5 +247,5 @@
                                  RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE);
                  if (RT_FAILURE(rc))
-                     VBoxServiceError("Cat: Could not open input file \"%s\"! rc=%Rrc\n",
+                     VBoxServiceError("cat: Could not open input file \"%s\"! rc=%Rrc\n",
                                       ValueUnion.psz, rc);
                  break;
@@ -205,4 +286,9 @@
             rc = VBoxServiceToolboxCat(argc, argv);
         }
+        else if (   !strcmp(argv[0], "mkdir")
+                 || !strcmp(argv[0], "vbox_mkdir"))
+        {
+            rc = VBoxServiceToolboxMkDir(argc, argv);
+        }
     }
 
