Index: /trunk/doc/manual/en_US/man_VBoxManage-unregistervm.xml
===================================================================
--- /trunk/doc/manual/en_US/man_VBoxManage-unregistervm.xml	(revision 97366)
+++ /trunk/doc/manual/en_US/man_VBoxManage-unregistervm.xml	(revision 97367)
@@ -55,5 +55,4 @@
       </group>
       <arg>--delete</arg>
-      <arg>--delete-all</arg>
     </cmdsynopsis>
   </refsynopsisdiv>
@@ -96,12 +95,4 @@
           </itemizedlist></listitem>
       </varlistentry>
-      <varlistentry>
-        <term><option>--delete-all</option></term>
-        <listitem><para>
-            Deletes the files described in the <option>--delete</option> option,
-            as well as all DVDs and Floppy disks located in the VM folder and
-            attached only to this VM.
-          </para></listitem>
-      </varlistentry>
     </variablelist>
   </refsect1>
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 97366)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp	(revision 97367)
@@ -171,6 +171,4 @@
     { "--delete",       'd', RTGETOPT_REQ_NOTHING },
     { "-delete",        'd', RTGETOPT_REQ_NOTHING },    // deprecated
-    { "--delete-all",   'a', RTGETOPT_REQ_NOTHING },
-    { "-delete-all",    'a', RTGETOPT_REQ_NOTHING },    // deprecated
 };
 
@@ -180,5 +178,4 @@
     const char *VMName = NULL;
     bool fDelete = false;
-    bool fDeleteAll = false;
 
     int c;
@@ -194,8 +191,4 @@
             case 'd':   // --delete
                 fDelete = true;
-                break;
-
-            case 'a':   // --delete-all
-                fDeleteAll = true;
                 break;
 
@@ -231,9 +224,8 @@
                     RTEXITCODE_FAILURE);
     SafeIfaceArray<IMedium> aMedia;
-    CHECK_ERROR_RET(machine, Unregister(fDeleteAll ? CleanupMode_DetachAllReturnHardDisksAndVMRemovable
-                                                   :CleanupMode_DetachAllReturnHardDisksOnly,
+    CHECK_ERROR_RET(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly,
                                         ComSafeArrayAsOutParam(aMedia)),
                     RTEXITCODE_FAILURE);
-    if (fDelete || fDeleteAll)
+    if (fDelete)
     {
         ComPtr<IProgress> pProgress;
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 97366)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 97367)
@@ -6517,22 +6517,19 @@
   <enum
     name="CleanupMode"
-    uuid="1ec1df9e-9b0e-43cd-ad4d-a34e10edb0c5"
+    uuid="67897c50-7cca-47a9-83f6-ce8fd8eb5441"
     >
     <desc>Cleanup mode, used with <link to="IMachine::unregister" />.
     </desc>
-    <const name="UnregisterOnly"                          value="1">
+    <const name="UnregisterOnly"                  value="1">
       <desc>Unregister only the machine, but neither delete snapshots nor detach media.</desc>
     </const>
-    <const name="DetachAllReturnNone"                     value="2">
+    <const name="DetachAllReturnNone"             value="2">
       <desc>Delete all snapshots and detach all media but return none; this will keep all media registered.</desc>
     </const>
-    <const name="DetachAllReturnHardDisksOnly"            value="3">
+    <const name="DetachAllReturnHardDisksOnly"    value="3">
       <desc>Delete all snapshots, detach all media and return hard disks for closing, but not removable media.</desc>
     </const>
-    <const name="Full"                                    value="4">
+    <const name="Full"                            value="4">
       <desc>Delete all snapshots, detach all media and return all media for closing.</desc>
-    </const>
-    <const name="DetachAllReturnHardDisksAndVMRemovable"  value="5">
-      <desc>Delete all snapshots, detach all media and return hard disks and removable locating in the folder of the machine to be deleted and referenced only to this machine, for closing.</desc>
     </const>
   </enum>
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 97366)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 97367)
@@ -68,5 +68,5 @@
 #include "USBDeviceImpl.h"
 #include "RemoteUSBDeviceImpl.h"
-#include "ConsoleSharedFolderImpl.h"
+#include "SharedFolderImpl.h"
 #ifdef VBOX_WITH_AUDIO_VRDE
 # include "DrvAudioVRDE.h"
Index: /trunk/src/VBox/Main/src-server/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 97366)
+++ /trunk/src/VBox/Main/src-server/MachineImpl.cpp	(revision 97367)
@@ -49,5 +49,5 @@
 #include "USBDeviceFiltersImpl.h"
 #include "HostImpl.h"
-#include "MachineSharedFolderImpl.h"
+#include "SharedFolderImpl.h"
 #include "GuestOSTypeImpl.h"
 #include "VirtualBoxErrorInfoImpl.h"
@@ -11896,7 +11896,4 @@
  * adds hard disks to the list. If it is CleanupMode_Full, this adds all
  * media to the list.
- * CleanupMode_DetachAllReturnHardDisksAndVMRemovable adds hard disk and
- * also removable medias if they are located in the VM folder and referenced
- * only by this VM (media prepared by unattended installer).
  *
  * This gets called from Machine::Unregister, both for the actual Machine and
@@ -11944,16 +11941,6 @@
             AutoReadLock lock(pMedium COMMA_LOCKVAL_SRC_POS);
             DeviceType_T devType = pMedium->i_getDeviceType();
-            size_t cBackRefs = pMedium->i_getMachineBackRefCount();
-            Utf8Str strMediumLocation = pMedium->i_getLocationFull();
-            strMediumLocation.stripFilename();
-            Utf8Str strMachineFolder =  i_getSettingsFileFull();
-            strMachineFolder.stripFilename();
             if (    (    cleanupMode == CleanupMode_DetachAllReturnHardDisksOnly
                       && devType == DeviceType_HardDisk)
-                 || (    cleanupMode == CleanupMode_DetachAllReturnHardDisksAndVMRemovable
-                      && (    devType == DeviceType_HardDisk
-                           || (    cBackRefs <= 1
-                                && strMediumLocation == strMachineFolder
-                                && *pMedium->i_getFirstMachineBackrefId() == i_getId())))
                  || (cleanupMode == CleanupMode_Full)
                )
Index: /trunk/src/VBox/Main/src-server/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 97366)
+++ /trunk/src/VBox/Main/src-server/MediumImpl.cpp	(revision 97367)
@@ -5528,6 +5528,5 @@
 
         if (    !(m->formatObj->i_getCapabilities() & (  MediumFormatCapabilities_CreateDynamic
-                                                       | MediumFormatCapabilities_CreateFixed
-                                                       | MediumFormatCapabilities_File)))
+                                                       | MediumFormatCapabilities_CreateFixed)))
             throw setError(VBOX_E_NOT_SUPPORTED,
                            tr("Medium format '%s' does not support storage deletion"),
Index: /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 97366)
+++ /trunk/src/VBox/Main/src-server/UnattendedImpl.cpp	(revision 97367)
@@ -141,20 +141,18 @@
     bool            fMountOnly;
     Utf8Str         strImagePath;
-    bool            fAuxiliary;
 
     UnattendedInstallationDisk(StorageBus_T a_enmBusType, Utf8Str const &a_rBusName, DeviceType_T a_enmDeviceType,
                                AccessMode_T a_enmAccessType, LONG a_iPort, LONG a_iDevice, bool a_fMountOnly,
-                               Utf8Str const &a_rImagePath, bool a_fAuxiliary)
+                               Utf8Str const &a_rImagePath)
         : enmBusType(a_enmBusType), strControllerName(a_rBusName), enmDeviceType(a_enmDeviceType), enmAccessType(a_enmAccessType)
-        , iPort(a_iPort), iDevice(a_iDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath), fAuxiliary(a_fAuxiliary)
+        , iPort(a_iPort), iDevice(a_iDevice), fMountOnly(a_fMountOnly), strImagePath(a_rImagePath)
     {
         Assert(strControllerName.length() > 0);
     }
 
-    UnattendedInstallationDisk(std::list<ControllerSlot>::const_iterator const &itDvdSlot, Utf8Str const &a_rImagePath,
-                               bool a_fAuxiliary)
+    UnattendedInstallationDisk(std::list<ControllerSlot>::const_iterator const &itDvdSlot, Utf8Str const &a_rImagePath)
         : enmBusType(itDvdSlot->enmBus), strControllerName(itDvdSlot->strControllerName), enmDeviceType(DeviceType_DVD)
         , enmAccessType(AccessMode_ReadOnly), iPort(itDvdSlot->iPort), iDevice(itDvdSlot->iDevice)
-        , fMountOnly(!itDvdSlot->fFree), strImagePath(a_rImagePath), fAuxiliary(a_fAuxiliary)
+        , fMountOnly(!itDvdSlot->fFree), strImagePath(a_rImagePath)
     {
         Assert(strControllerName.length() > 0);
@@ -3054,5 +3052,5 @@
                                                                  0, 0,
                                                                  fFoundPort0Dev0 /*fMountOnly*/,
-                                                                 mpInstaller->getAuxiliaryFloppyFilePath(), false));
+                                                                 mpInstaller->getAuxiliaryFloppyFilePath()));
     return S_OK;
 }
@@ -3213,5 +3211,5 @@
     if (mpInstaller->isAuxiliaryIsoNeeded() && mpInstaller->bootFromAuxiliaryIso())
     {
-        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath(), true));
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
         ++itDvdSlot;
     }
@@ -3219,5 +3217,5 @@
     if (mpInstaller->isOriginalIsoNeeded())
     {
-        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getIsoPath(), false));
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getIsoPath()));
         ++itDvdSlot;
     }
@@ -3225,5 +3223,5 @@
     if (mpInstaller->isAuxiliaryIsoNeeded() && !mpInstaller->bootFromAuxiliaryIso())
     {
-        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath(), true));
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, mpInstaller->getAuxiliaryIsoFilePath()));
         ++itDvdSlot;
     }
@@ -3232,5 +3230,5 @@
     if (mpInstaller->isAdditionsIsoNeeded())
     {
-        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getAdditionsIsoPath(), false));
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getAdditionsIsoPath()));
         ++itDvdSlot;
     }
@@ -3238,5 +3236,5 @@
     if (mpInstaller->isValidationKitIsoNeeded())
     {
-        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getValidationKitIsoPath(), false));
+        rVecInstallatationDisks.push_back(UnattendedInstallationDisk(itDvdSlot, i_getValidationKitIsoPath()));
         ++itDvdSlot;
     }
@@ -4209,36 +4207,30 @@
 
     ComPtr<IMedium> ptrMedium;
-    HRESULT hrc = mParent->OpenMedium(Bstr(pImage->strImagePath).raw(),
-                                      pImage->enmDeviceType,
-                                      pImage->enmAccessType,
-                                      true,
-                                      ptrMedium.asOutParam());
-    LogRelFlowFunc(("VirtualBox::openMedium -> %Rhrc\n", hrc));
-    if (SUCCEEDED(hrc))
-    {
-        if (pImage->fAuxiliary && pImage->strImagePath.endsWith(".viso"))
-        {
-            hrc = ptrMedium->SetProperty(Bstr("UnattendedInstall").raw(), Bstr("1").raw());
-            LogRelFlowFunc(("Medium::SetProperty -> %Rhrc\n", hrc));
-        }
-
+    HRESULT rc = mParent->OpenMedium(Bstr(pImage->strImagePath).raw(),
+                                     pImage->enmDeviceType,
+                                     pImage->enmAccessType,
+                                     true,
+                                     ptrMedium.asOutParam());
+    LogRelFlowFunc(("VirtualBox::openMedium -> %Rhrc\n", rc));
+    if (SUCCEEDED(rc))
+    {
         if (pImage->fMountOnly)
         {
             // mount the opened disk image
-            hrc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage->iPort,
-                                                  pImage->iDevice, ptrMedium, TRUE /*fForce*/);
-            LogRelFlowFunc(("Machine::MountMedium -> %Rhrc\n", hrc));
+            rc = rPtrSessionMachine->MountMedium(Bstr(pImage->strControllerName).raw(), pImage->iPort,
+                                                 pImage->iDevice, ptrMedium, TRUE /*fForce*/);
+            LogRelFlowFunc(("Machine::MountMedium -> %Rhrc\n", rc));
         }
         else
         {
             //attach the opened disk image to the controller
-            hrc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage->iPort,
-                                                   pImage->iDevice, pImage->enmDeviceType, ptrMedium);
-            LogRelFlowFunc(("Machine::AttachDevice -> %Rhrc\n", hrc));
+            rc = rPtrSessionMachine->AttachDevice(Bstr(pImage->strControllerName).raw(), pImage->iPort,
+                                                  pImage->iDevice, pImage->enmDeviceType, ptrMedium);
+            LogRelFlowFunc(("Machine::AttachDevice -> %Rhrc\n", rc));
         }
     }
 
     rLock.acquire();
-    return hrc;
+    return rc;
 }
 
Index: /trunk/src/VBox/Storage/VISO.cpp
===================================================================
--- /trunk/src/VBox/Storage/VISO.cpp	(revision 97366)
+++ /trunk/src/VBox/Storage/VISO.cpp	(revision 97367)
@@ -105,13 +105,4 @@
     { "viso",           VDTYPE_OPTICAL_DISC },
     { NULL,             VDTYPE_INVALID      }
-};
-
-/** NULL-terminated array of configuration option. */
-static const VDCONFIGINFO s_aVisoConfigInfo[] =
-{
-    /* Options for VMDK raw disks */
-    { "UnattendedInstall",     NULL,    VDCFGVALUETYPE_STRING,  VD_CFGKEY_EXPERT },
-    /* End of options list */
-    { NULL,                    NULL,    VDCFGVALUETYPE_INTEGER, 0 }
 };
 
@@ -524,146 +515,7 @@
 }
 
-/**
- * Scans the VISO file and removes all references to files
- * which are in the same folder as the VISO and
- * whose names begin with "Unattended-".
- *
- * @return VBox status code.
- *
- * @param pThis Pointer to VISO backend data.
- */
-static int deleteReferences(PVISOIMAGE pThis)
-{
-    /*
-     * Open the file and read it into memory.
-     */
-    PVDIOSTORAGE pStorage = NULL;
-    int vrc = vdIfIoIntFileOpen(pThis->pIfIo, pThis->pszFilename, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_NONE, &pStorage);
-    if (RT_FAILURE(vrc))
-    {
-        LogRel(("VISO: Unable to open file '%s': %Rrc\n", pThis->pszFilename, vrc));
-        return vrc;
-    }
-
-    LogRel(("VISO: Handling file '%s' references\n", pThis->pszFilename));
-
-    /*
-     * Read the file into memory.
-     */
-    uint64_t cbFile = 0;
-    vrc = vdIfIoIntFileGetSize(pThis->pIfIo, pStorage, &cbFile);
-    if (RT_SUCCESS(vrc))
-    {
-        if (cbFile <= VISO_MAX_FILE_SIZE)
-        {
-            char *pszContent = (char *)RTMemTmpAlloc(cbFile + 1);
-            if (pszContent)
-            {
-                vrc = vdIfIoIntFileReadSync(pThis->pIfIo, pStorage, 0 /*off*/, pszContent, (size_t)cbFile);
-                if (RT_SUCCESS(vrc))
-                {
-                    /*
-                     * Check the file marker.
-                     * Ignore leading blanks.
-                     */
-                    pszContent[(size_t)cbFile] = '\0';
-
-                    char *pszReadDst = pszContent;
-                    while (RT_C_IS_SPACE(*pszReadDst))
-                        pszReadDst++;
-                    if (strncmp(pszReadDst, RT_STR_TUPLE("--iprt-iso-maker-file-marker")) == 0)
-                    {
-                        vrc = visoParseUuid(pszReadDst, &pThis->Uuid);
-                        if (RT_SUCCESS(vrc))
-                        {
-                            /*
-                             * Make sure it's valid UTF-8 before letting
-                             */
-                            vrc = RTStrValidateEncodingEx(pszContent, cbFile + 1,
-                                                          RTSTR_VALIDATE_ENCODING_EXACT_LENGTH
-                                                          | RTSTR_VALIDATE_ENCODING_ZERO_TERMINATED);
-                            if (RT_SUCCESS(vrc))
-                            {
-                                /*
-                                 * Convert it into an argument vector.
-                                 * Free the content afterwards to reduce memory pressure.
-                                 */
-                                uint32_t fGetOpt = strncmp(pszReadDst, RT_STR_TUPLE("--iprt-iso-maker-file-marker-ms")) != 0
-                                                 ? RTGETOPTARGV_CNV_QUOTE_BOURNE_SH : RTGETOPTARGV_CNV_QUOTE_MS_CRT;
-                                fGetOpt |= RTGETOPTARGV_CNV_MODIFY_INPUT;
-                                char **papszArgs;
-                                int    cArgs;
-                                vrc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszContent, fGetOpt, NULL);
-
-                                if (RT_SUCCESS(vrc))
-                                {
-                                    for (int i = 0; i < cArgs; ++i)
-                                    {
-                                        char *pszArg = papszArgs[i];
-                                        char *pszOffset = strrchr(pszArg, '=');
-                                        if (pszOffset != NULL)
-                                            pszArg = pszOffset + 1;
-
-                                        /* if it isn't option */
-                                        if (pszArg[0] != '-')
-                                        {
-                                            char *pszPath = RTPathAbsExDup(pThis->pszCwd, pszArg, 0);
-                                            if (RTStrStartsWith((const char *)pszPath, pThis->pszCwd))
-                                            {
-                                                char *pszFileName = RTPathFilename(pszPath);
-                                                if (   pszFileName != NULL
-                                                    && RTStrStartsWith((const char *)pszFileName, "Unattended-"))
-                                                {
-                                                    vrc = RTFileDelete(pszPath);
-                                                    if (RT_SUCCESS(vrc))
-                                                        LogRel(("VISO: file '%s' deleted\n", pszPath));
-                                                    else
-                                                        LogRel(("VISO: Failed to delete the file '%s' (%Rrc)\n", pszPath, vrc));
-                                                    vrc = VINF_SUCCESS;
-                                                }
-                                            }
-                                            RTStrFree(pszPath);
-                                        }
-                                    }
-                                    RTGetOptArgvFreeEx(papszArgs, fGetOpt);
-                                    papszArgs = NULL;
-                                }
-                                else
-                                    vdIfError(pThis->pIfError, vrc, RT_SRC_POS, "VISO: RTGetOptArgvFromString failed: %Rrc", vrc);
-                            }
-                            else
-                                vdIfError(pThis->pIfError, vrc, RT_SRC_POS, "VISO: Invalid file encoding");
-                        }
-                        else
-                            vdIfError(pThis->pIfError, vrc, RT_SRC_POS, "VISO: Parsing UUID failed: %Rrc", vrc);
-                    }
-                    else
-                        vrc = VERR_VD_GEN_INVALID_HEADER;
-                }
-                else
-                    vdIfError(pThis->pIfError, vrc, RT_SRC_POS, "VISO: Reading file failed: %Rrc", vrc);
-
-                RTMemTmpFree(pszContent);
-            }
-            else
-                vrc = VERR_NO_TMP_MEMORY;
-        }
-        else
-        {
-            LogRel(("visoOpen: VERR_VD_INVALID_SIZE - cbFile=%#RX64 cbMaxFile=%#RX64\n",
-                    cbFile, (uint64_t)VISO_MAX_FILE_SIZE));
-            vrc = VERR_VD_INVALID_SIZE;
-        }
-    }
-
-    if (RT_FAILURE(vrc))
-        LogRel(("VISO: Handling of file '%s' failed with %Rrc\n", pThis->pszFilename, vrc));
-
-    vdIfIoIntFileClose(pThis->pIfIo, pStorage);
-    return vrc;
-}
-
-/**
-* @interface_method_impl{VDIMAGEBACKEND,pfnClose}
+
+/**
+ * @interface_method_impl{VDIMAGEBACKEND,pfnClose}
  */
 static DECLCALLBACK(int) visoClose(void *pBackendData, bool fDelete)
@@ -675,19 +527,5 @@
     {
         if (fDelete)
-        {
-            PVDINTERFACECONFIG pImgCfg = VDIfConfigGet(&pThis->pIfIo->Core);
-
-            bool fUnattendedInstall = false;
-            int vrc = VDCFGQueryBool(pImgCfg, "UnattendedInstall", &fUnattendedInstall);
-
-            /*
-            * The VISO created by unattended installer, so delete all generated files
-            * included in the VISO. the file is considered generated if it is located
-            * in the same folder as VISO and its name begins with "Unattended-"
-            */
-            if (RT_SUCCESS(vrc) && fUnattendedInstall)
-                deleteReferences(pThis);
             vdIfIoIntFileDelete(pThis->pIfIo, pThis->pszFilename);
-        }
 
         if (pThis->hIsoFile != NIL_RTVFSFILE)
@@ -1031,5 +869,5 @@
     g_aVBoXIsoMakerFileExtensions,
     /* paConfigInfo */
-    s_aVisoConfigInfo,
+    NULL,
     /* pfnProbe */
     visoProbe,
