Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 16975)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 17033)
@@ -315,4 +315,10 @@
     {
         RTPrintf("VBoxManage import           <ovf>\n"
+                 "\n"); // @todo
+    }
+
+    if (u64Cmd & USAGE_EXPORTAPPLIANCE)
+    {
+        RTPrintf("VBoxManage export           <machines> -o <ovf>\n"
                  "\n");
     }
@@ -3007,4 +3013,5 @@
         { "metrics",          handleMetrics },
         { "import",           handleImportAppliance },
+        { "export",           handleExportAppliance },
         { NULL,               NULL }
     };
Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 16975)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 17033)
@@ -87,4 +87,5 @@
 #define USAGE_CONVERTHD             RT_BIT_64(43)
 #define USAGE_IMPORTAPPLIANCE       RT_BIT_64(44)
+#define USAGE_EXPORTAPPLIANCE       RT_BIT_64(45)
 #define USAGE_ALL                   (~(uint64_t)0)
 /** @} */
@@ -170,4 +171,5 @@
 // VBoxManageImport.cpp
 int handleImportAppliance(HandlerArg *a);
+int handleExportAppliance(HandlerArg *a);
 
 /* VBoxManageUSB.cpp */
Index: trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
===================================================================
--- trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp	(revision 16975)
+++ trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp	(revision 17033)
@@ -98,4 +98,5 @@
         Utf8Str strThisArg(a->argv[i]);
         if (    (strThisArg == "--dry-run")
+             || (strThisArg == "-dry-run")
              || (strThisArg == "-n")
            )
@@ -156,16 +157,16 @@
     {
         Bstr bstrOvfFilename(strOvfFilename);
-        ComPtr<IAppliance> appliance;
-        CHECK_ERROR_BREAK(a->virtualBox, CreateAppliance(appliance.asOutParam()));
-
-        CHECK_ERROR_BREAK(appliance, Read(bstrOvfFilename));
+        ComPtr<IAppliance> pAppliance;
+        CHECK_ERROR_BREAK(a->virtualBox, CreateAppliance(pAppliance.asOutParam()));
+
+        CHECK_ERROR_BREAK(pAppliance, Read(bstrOvfFilename));
 
         RTPrintf("Interpreting %s... ", strOvfFilename.c_str());
-        CHECK_ERROR_BREAK(appliance, Interpret());
+        CHECK_ERROR_BREAK(pAppliance, Interpret());
         RTPrintf("OK.\n");
 
         // fetch all disks
         com::SafeArray<BSTR> retDisks;
-        CHECK_ERROR_BREAK(appliance,
+        CHECK_ERROR_BREAK(pAppliance,
                           COMGETTER(Disks)(ComSafeArrayAsOutParam(retDisks)));
         if (retDisks.size() > 0)
@@ -179,5 +180,5 @@
         // fetch virtual system descriptions
         com::SafeIfaceArray<IVirtualSystemDescription> aVirtualSystemDescriptions;
-        CHECK_ERROR_BREAK(appliance,
+        CHECK_ERROR_BREAK(pAppliance,
                           COMGETTER(VirtualSystemDescriptions)(ComSafeArrayAsOutParam(aVirtualSystemDescriptions)));
 
@@ -469,5 +470,5 @@
             {
                 ComPtr<IProgress> progress;
-                CHECK_ERROR_BREAK(appliance,
+                CHECK_ERROR_BREAK(pAppliance,
                                   ImportMachines(progress.asOutParam()));
 
@@ -492,3 +493,75 @@
 }
 
+int handleExportAppliance(HandlerArg *a)
+{
+    HRESULT rc = S_OK;
+
+    Utf8Str strOutputFile;
+    std::list< ComPtr<IMachine> > llMachines;
+
+    do
+    {
+        for (int i = 0;
+            i < a->argc;
+            ++i)
+        {
+            Utf8Str strThisArg(a->argv[i]);
+
+            if (    strThisArg == "--output"
+                || strThisArg == "-output"
+                || strThisArg == "-o"
+            )
+            {
+                if (++i < a->argc)
+                {
+                    if (strOutputFile.length())
+                        return errorSyntax(USAGE_EXPORTAPPLIANCE, "You can only specify --output once.");
+                    else
+                        strOutputFile = strThisArg;
+                }
+                else
+                    return errorSyntax(USAGE_EXPORTAPPLIANCE, "Missing argument to --output option.");
+            }
+            else
+            {
+                // must be machine: try UUID or name
+                ComPtr<IMachine> machine;
+                /* assume it's a UUID */
+                rc = a->virtualBox->GetMachine(Guid(strThisArg), machine.asOutParam());
+                if (FAILED(rc) || !machine)
+                {
+                    /* must be a name */
+                    CHECK_ERROR_BREAK(a->virtualBox, FindMachine(Bstr(strThisArg), machine.asOutParam()));
+                }
+
+                if (machine)
+                    llMachines.push_back(machine);
+            }
+        }
+
+        if (llMachines.size() == 0)
+            return errorSyntax(USAGE_EXPORTAPPLIANCE, "Missing arguments to export command.");
+
+        ComPtr<IAppliance> pAppliance;
+        CHECK_ERROR_BREAK(a->virtualBox, CreateAppliance(pAppliance.asOutParam()));
+
+        std::list< ComPtr<IMachine> >::iterator itM;
+        for (itM = llMachines.begin();
+             itM != llMachines.end();
+             ++itM)
+        {
+            ComPtr<IMachine> pMachine = *itM;
+            CHECK_ERROR_BREAK(pMachine, Export(pAppliance));
+        }
+
+        if (FAILED(rc))
+            break;
+
+        CHECK_ERROR_BREAK(pAppliance, Write(Bstr(strOutputFile)));
+
+    } while (0);
+
+    return SUCCEEDED(rc) ? 0 : 1;
+}
+
 #endif /* !VBOX_ONLY_DOCS */
