Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 70581)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 70582)
@@ -105,4 +105,5 @@
     { "unregistervm",       USAGE_UNREGISTERVM,     VBMG_CMD_TODO, handleUnregisterVM,         0 },
     { "clonevm",            USAGE_CLONEVM,          VBMG_CMD_TODO, handleCloneVM,              0 },
+    { "movevm",             USAGE_MOVEVM,           VBMG_CMD_TODO, handleMoveVM,               0 },
     { "mediumproperty",     USAGE_MEDIUMPROPERTY,   VBMG_CMD_TODO, handleMediumProperty,       0 },
     { "hdproperty",         USAGE_MEDIUMPROPERTY,   VBMG_CMD_TODO, handleMediumProperty,       0 }, /* backward compatibility */
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 70581)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h	(revision 70582)
@@ -62,4 +62,5 @@
 #define USAGE_MODIFYMEDIUM          RT_BIT_64(14)
 #define USAGE_CLONEMEDIUM           RT_BIT_64(15)
+#define USAGE_MOVEVM                RT_BIT_64(16)
 #define USAGE_CREATEHOSTIF          RT_BIT_64(17)
 #define USAGE_REMOVEHOSTIF          RT_BIT_64(18)
@@ -277,4 +278,5 @@
 RTEXITCODE handleExtPack(HandlerArg *a);
 RTEXITCODE handleUnattended(HandlerArg *a);
+RTEXITCODE handleMoveVM(HandlerArg *a);
 
 /* VBoxManageDisk.cpp */
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 70581)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp	(revision 70582)
@@ -732,4 +732,11 @@
                      "                            [--uuid <uuid>]\n"
                      "                            [--register]\n"
+                     "\n", SEP);
+
+    if (fCategory & USAGE_MOVEVM)
+        RTStrmPrintf(pStrm,
+                           "%s movevm %s          <uuid|vmname>\n"
+                     "                            --type basic\n"
+                     "                            [--folder <path>]\n"
                      "\n", SEP);
 
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 70581)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 70582)
@@ -292,4 +292,96 @@
 
     return SUCCEEDED(rc) ? RTEXITCODE_SUCCESS : RTEXITCODE_FAILURE;
+}
+
+static const RTGETOPTDEF g_aMoveVMOptions[] =
+{
+    { "--type",           't', RTGETOPT_REQ_STRING },
+    { "--folder",         'f', RTGETOPT_REQ_STRING },
+};
+
+RTEXITCODE handleMoveVM(HandlerArg *a)
+{
+    HRESULT                        rc;
+    const char                    *pszSrcName      = NULL;
+    const char                    *pszTargetFolder = NULL;
+    const char                    *pszType         = NULL;
+
+    int c;
+    int vrc = VINF_SUCCESS;
+    RTGETOPTUNION ValueUnion;
+    RTGETOPTSTATE GetState;
+
+    // start at 0 because main() has hacked both the argc and argv given to us
+    RTGetOptInit(&GetState, a->argc, a->argv, g_aMoveVMOptions, RT_ELEMENTS(g_aMoveVMOptions),
+                 0, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
+    while ((c = RTGetOpt(&GetState, &ValueUnion)))
+    {
+        switch (c)
+        {
+            case 't':   // --type
+                pszType = ValueUnion.psz;
+                break;
+
+            case 'f':   // --target folder
+
+                char szPath[RTPATH_MAX];
+                pszTargetFolder = ValueUnion.psz;
+
+                vrc = RTPathAbs(pszTargetFolder, szPath, sizeof(szPath));
+                if (RT_FAILURE(vrc))
+                    return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTPathAbs(%s,,) failed with rc=%Rrc", pszTargetFolder, vrc);
+                break;
+
+            case VINF_GETOPT_NOT_OPTION:
+                if (!pszSrcName)
+                    pszSrcName = ValueUnion.psz;
+                else
+                    return errorSyntax(USAGE_MOVEVM, "Invalid parameter '%s'", ValueUnion.psz);
+                break;
+
+            default:
+                return errorGetOpt(USAGE_MOVEVM, c, &ValueUnion);
+        }
+    }
+
+
+    /* Check for required options */
+    if (!pszSrcName)
+        return errorSyntax(USAGE_MOVEVM, "VM name required");
+
+    /* Get the machine object */
+    ComPtr<IMachine> srcMachine;
+    CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(pszSrcName).raw(),
+                                               srcMachine.asOutParam()),
+                    RTEXITCODE_FAILURE);
+
+    if (srcMachine)
+    {
+        /* Start the moving */
+        ComPtr<IProgress> progress;
+        do
+        {
+            /* we have to open a session for this task */
+            CHECK_ERROR_BREAK(srcMachine, LockMachine(a->session, LockType_Write));
+            ComPtr<IMachine> sessionMachine;
+            do
+            {
+                CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()));
+                CHECK_ERROR_BREAK(sessionMachine, MoveTo(Bstr(pszTargetFolder).raw(),
+                                       Bstr(pszType).raw(),
+                                       progress.asOutParam()));
+                rc = showProgress(progress);
+                CHECK_PROGRESS_ERROR_RET(progress, ("Move VM failed"), RTEXITCODE_FAILURE);
+//              CHECK_ERROR_BREAK(sessionMachine, SaveSettings());
+            } while (0);
+
+            sessionMachine.setNull();
+            CHECK_ERROR_BREAK(a->session, UnlockMachine());
+        } while (0);
+    }
+
+    RTPrintf("Machine has been successfully moved into %s\n", pszTargetFolder);
+
+    return RTEXITCODE_SUCCESS;
 }
 
Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 70581)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 70582)
@@ -461,4 +461,5 @@
 	src-server/MachineImpl.cpp \
 	src-server/MachineImplCloneVM.cpp \
+	src-server/MachineImplMoveVM.cpp \
 	src-server/Matching.cpp \
 	src-server/MediumAttachmentImpl.cpp \
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 70581)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 70582)
@@ -4776,5 +4776,5 @@
   <interface
     name="IMachine" extends="$unknown"
-    uuid="85cd948e-a71f-4289-281e-0ca7ad48cd89"
+    uuid="fecae8e8-46da-44cf-8fc0-2ba9aeb796a7"
     wsmap="managed"
     wrap-hint-server-addinterfaces="IInternalMachineControl"
@@ -7977,4 +7977,30 @@
         <desc>Options for the cloning operation.</desc>
       </param>
+      <param name="progress" type="IProgress" dir="return">
+        <desc>Progress object to track the operation completion.</desc>
+      </param>
+    </method>
+
+    <method name="moveTo">
+      <desc>
+	Move machine on to new place/folder
+        <result name="E_INVALIDARG">
+          @a target is @c null.
+        </result>
+      </desc>
+
+      <param name="folder" type="wstring" dir="in">
+        <desc>Target folder where machine is moved.</desc>
+      </param>
+
+      <param name="type" type="wstring" dir="in">
+        <desc>Type of moving.
+	   Possible values:
+		basic - Only the files which belong solely to this machine 
+		        are moved from the original machine's folder to 
+			a new folder.		   
+	</desc>
+      </param>
+
       <param name="progress" type="IProgress" dir="return">
         <desc>Progress object to track the operation completion.</desc>
Index: /trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MachineImpl.h	(revision 70581)
+++ /trunk/src/VBox/Main/include/MachineImpl.h	(revision 70582)
@@ -827,5 +827,5 @@
 
     friend class MachineCloneVM;
-
+    friend class MachineMoveVM;
 private:
     // wrapped IMachine properties
@@ -1188,4 +1188,7 @@
                     const std::vector<CloneOptions_T> &aOptions,
                     ComPtr<IProgress> &aProgress);
+    HRESULT moveTo(const com::Utf8Str &aTargetPath,
+                   const com::Utf8Str &aType,
+                   ComPtr<IProgress> &aProgress);
     HRESULT saveState(ComPtr<IProgress> &aProgress);
     HRESULT adoptSavedState(const com::Utf8Str &aSavedStateFile);
Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 70581)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 70582)
@@ -45,4 +45,5 @@
 #include "AutostartDb.h"
 #include "SystemPropertiesImpl.h"
+#include "MachineImplMoveVM.h"
 
 // generated header
@@ -7223,4 +7224,52 @@
     pP.queryInterfaceTo(aProgress.asOutParam());
 
+    return rc;
+
+}
+
+HRESULT Machine::moveTo(const com::Utf8Str &aTargetPath,
+                        const com::Utf8Str &aType,
+                        ComPtr<IProgress> &aProgress)
+{
+    LogFlowThisFuncEnter();
+
+    ComObjPtr<Progress> progress;
+
+    progress.createObject();
+
+    HRESULT rc = S_OK;
+    Utf8Str targetPath = aTargetPath;
+    Utf8Str type = aType;
+
+    /* Initialize our worker task */
+    MachineMoveVM* task = NULL;
+    try
+    {
+        task = new MachineMoveVM(this, targetPath, type, progress);
+    }
+    catch(...)
+    {
+        delete task;
+        return rc;
+    }
+
+    /*
+     * task pointer will be owned by the ThreadTask class.
+     * There is no need to call operator "delete" in the end.
+     */ 
+    rc = task->init();
+    if (SUCCEEDED(rc))
+    {
+        rc = task->createThread();
+        if (FAILED(rc)) 
+        {
+            setError(rc, tr("Could not run the thread for the task MachineMoveVM"));
+        }
+
+        /* Return progress to the caller */
+        progress.queryInterfaceTo(aProgress.asOutParam());
+    }
+
+    LogFlowThisFuncLeave();
     return rc;
 
