Index: trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 24556)
+++ trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 24557)
@@ -256,6 +256,5 @@
                              KStorageBus aBus, LONG aChannel, LONG aDevice);
 
-    void cannotMountMedium (QWidget *aParent, const CMachine &aMachine, const VBoxMedium &aMedium);
-    void cannotUnmountMedium (QWidget *aParent, const CMachine &aMachine, const VBoxMedium &aMedium);
+    int cannotRemountMedium (QWidget *aParent, const CMachine &aMachine, const VBoxMedium &aMedium, bool aMount, bool aRetry);
     void cannotOpenMedium (QWidget *aParent, const CVirtualBox &aVBox,
                            VBoxDefs::MediumType aType, const QString &aLocation);
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 24556)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 24557)
@@ -198,11 +198,11 @@
 struct MountTarget
 {
-    MountTarget() : name (QString ("")), port (0), device (0), id (QString ("")), type (VBoxDefs::MediumType_Invalid) {}
+    MountTarget() : name (QString ("")), port (0), device (0), id (QString()), type (VBoxDefs::MediumType_Invalid) {}
     MountTarget (const QString &aName, LONG aPort, LONG aDevice)
-        : name (aName), port (aPort), device (aDevice), id (QString ("")), type (VBoxDefs::MediumType_Invalid) {}
+        : name (aName), port (aPort), device (aDevice), id (QString()), type (VBoxDefs::MediumType_Invalid) {}
     MountTarget (const QString &aName, LONG aPort, LONG aDevice, const QString &aId)
         : name (aName), port (aPort), device (aDevice), id (aId), type (VBoxDefs::MediumType_Invalid) {}
-    MountTarget (const QString &aName, LONG aPort, LONG aDevice, const QString &aId, VBoxDefs::MediumType aType)
-        : name (aName), port (aPort), device (aDevice), id (aId), type (aType) {}
+    MountTarget (const QString &aName, LONG aPort, LONG aDevice, VBoxDefs::MediumType aType)
+        : name (aName), port (aPort), device (aDevice), id (QString()), type (aType) {}
     QString name;
     LONG port;
@@ -327,4 +327,7 @@
         *aSelf = this;
 
+    /* Cache IMedium data! */
+    vboxGlobal().startEnumeratingMedia();
+
 #if !(defined (Q_WS_WIN) || defined (Q_WS_MAC))
     /* The default application icon (will change to the VM-specific icon in
@@ -1054,6 +1057,5 @@
 
     if (!vbox.isOk())
-        return vboxProblem().cannotOpenMedium (this, vbox,
-                                               VBoxDefs::MediumType_DVD, aSource);
+        return vboxProblem().cannotOpenMedium (this, vbox, VBoxDefs::MediumType_DVD, aSource);
 
     Assert (!uuid.isNull());
@@ -1088,20 +1090,34 @@
     if (!ctrName.isNull())
     {
+        bool isMounted = false;
+
+        /* Mount medium to the predefined port/device */
         m.MountMedium (ctrName, ctrPort, ctrDevice, uuid, false /* force */);
-        AssertWrapperOk (m);
         if (m.isOk())
-        {
-            if (mIsAutoSaveMedia)
+            isMounted = true;
+        else
+        {
+            /* Ask for force mounting */
+            if (vboxProblem().cannotRemountMedium (this, m, VBoxMedium (image, VBoxDefs::MediumType_DVD), true /* mount? */, true /* retry? */) == QIMessageBox::Ok)
             {
-                m.SaveSettings();
-                if (!m.isOk())
-                    vboxProblem().cannotSaveMachineSettings (m);
+                /* Force mount medium to the predefined port/device */
+                m.MountMedium (ctrName, ctrPort, ctrDevice, uuid, true /* force */);
+                if (m.isOk())
+                    isMounted = true;
+                else
+                    vboxProblem().cannotRemountMedium (this, m, VBoxMedium (image, VBoxDefs::MediumType_DVD), true /* mount? */, false /* retry? */);
             }
         }
+
+        /* Save medium mounted at runtime */
+        if (isMounted && mIsAutoSaveMedia)
+        {
+            m.SaveSettings();
+            if (!m.isOk())
+                vboxProblem().cannotSaveMachineSettings (m);
+        }
     }
     else
-    {
         vboxProblem().cannotMountGuestAdditions (m.GetName());
-    }
 }
 
@@ -2270,5 +2286,4 @@
                                                                       attachment.GetPort(),
                                                                       attachment.GetDevice(),
-                                                                      QString (""),
                                                                       mediumType)));
             connect (callVMMAction, SIGNAL (triggered (bool)), this, SLOT (mountMedium()));
@@ -2344,34 +2359,60 @@
 void VBoxConsoleWnd::mountMedium()
 {
+    /* Get sender action */
     QAction *action = qobject_cast <QAction*> (sender());
     Assert (action);
 
+    /* Get current machine */
+    CMachine machine = mSession.GetMachine();
+
+    /* Get mount-target */
     MountTarget target = action->data().value <MountTarget>();
-    CMachine machine = mSession.GetMachine();
-    CMediumAttachment attachment = machine.GetMediumAttachment (target.name, target.port, target.device);
-    CMedium medium = attachment.GetMedium();
-
-    if (target.type != VBoxDefs::MediumType_Invalid)
+
+    /* Current mount-target attributes */
+    CMediumAttachment currentAttachment = machine.GetMediumAttachment (target.name, target.port, target.device);
+    CMedium currentMedium = currentAttachment.GetMedium();
+    QString currentId = currentMedium.isNull() ? QString ("") : currentMedium.GetId();
+
+    /* New mount-target attributes */
+    QString newId = QString ("");
+    bool selectWithMediaManager = target.type != VBoxDefs::MediumType_Invalid;
+
+    /* Open Virtual Media Manager to select image id */
+    if (selectWithMediaManager)
     {
         /* Search for already used images */
         QStringList usedImages;
-        const CMediumAttachmentVector &attachments = mSession.GetMachine().GetMediumAttachments();
-        foreach (const CMediumAttachment &index, attachments)
-        {
-            if (index != attachment && !index.GetMedium().isNull() && !index.GetMedium().GetHostDrive())
-                usedImages << index.GetMedium().GetId();
+        foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
+        {
+            CMedium medium = attachment.GetMedium();
+            if (attachment != currentAttachment && !medium.isNull() && !medium.GetHostDrive())
+                usedImages << medium.GetId();
         }
         /* Open VMM Dialog */
         VBoxMediaManagerDlg dlg (this);
-        dlg.setup (target.type, true /* do select? */, true /* do refresh? */,
-                   mSession.GetMachine(), QString(), true, usedImages);
+        dlg.setup (target.type, true /* select? */, true /* refresh? */, machine, currentId, true, usedImages);
         if (dlg.exec() == QDialog::Accepted)
-            target.id = dlg.selectedId();
+            newId = dlg.selectedId();
         else return;
     }
-
-    machine.MountMedium (target.name, target.port, target.device,
-                         target.id.isEmpty() || medium.isNull() || medium.GetId() != target.id ||
-                         target.type != VBoxDefs::MediumType_Invalid ? target.id : QString (""), false /* force */);
+    /* Use medium which was sent */
+    else if (!target.id.isNull() && target.id != currentId)
+        newId = target.id;
+
+    bool mount = !newId.isEmpty();
+
+    /* Remount medium to the predefined port/device */
+    machine.MountMedium (target.name, target.port, target.device, newId, false /* force */);
+    if (!machine.isOk())
+    {
+        /* Ask for force remounting */
+        if (vboxProblem().cannotRemountMedium (this, machine, vboxGlobal().findMedium (mount ? newId : currentId), mount, true /* retry? */) == QIMessageBox::Ok)
+        {
+            /* Force remount medium to the predefined port/device. */
+            machine.MountMedium (target.name, target.port, target.device, newId, true /* force */);
+            if (!machine.isOk())
+                vboxProblem().cannotRemountMedium (this, machine, vboxGlobal().findMedium (mount ? newId : currentId), mount, false /* retry? */);
+        }
+    }
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 24556)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaManagerDlg.cpp	(revision 24557)
@@ -1205,6 +1205,5 @@
                     if (!machine.isOk())
                     {
-                        CStorageController controller = machine.GetStorageControllerByName (attachment.GetController());
-                        vboxProblem().cannotUnmountMedium (this, machine, aMedium);
+                        vboxProblem().cannotRemountMedium (this, machine, aMedium, false /* mount? */, false /* retry? */);
                         success = false;
                         break;
@@ -1227,6 +1226,5 @@
                     if (!machine.isOk())
                     {
-                        CStorageController controller = machine.GetStorageControllerByName (attachment.GetController());
-                        vboxProblem().cannotUnmountMedium (this, machine, aMedium);
+                        vboxProblem().cannotRemountMedium (this, machine, aMedium, false /* mount? */, false /* retry? */);
                         success = false;
                         break;
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 24556)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 24557)
@@ -1187,30 +1187,38 @@
 }
 
-void VBoxProblemReporter::cannotMountMedium (QWidget *aParent, const CMachine &aMachine,
-                                             const VBoxMedium &aMedium)
+int VBoxProblemReporter::cannotRemountMedium (QWidget *aParent, const CMachine &aMachine,
+                                              const VBoxMedium &aMedium, bool aMount, bool aRetry)
 {
     /** @todo (translation-related): the gender of "the" in translations
      * will depend on the gender of aMedium.type(). */
-    message (aParent, Error,
-             tr ("Failed to mount the %1 <nobr><b>%2</b></nobr> "
-                 "to the machine <b>%3</b>.")
-                 .arg (mediumToAccusative (aMedium.type(), aMedium.isHostDrive()))
-                 .arg (aMedium.isHostDrive() ? aMedium.name() : aMedium.location())
-                 .arg (CMachine (aMachine).GetName()),
-             formatErrorInfo (aMachine));
-}
-
-void VBoxProblemReporter::cannotUnmountMedium (QWidget *aParent, const CMachine &aMachine,
-                                               const VBoxMedium &aMedium)
-{
-    /** @todo (translation-related): the gender of "the" in translations
-     * will depend on the gender of aMedium.type(). */
-    message (aParent, Error,
-             tr ("Failed to unmount the %1 <nobr><b>%2</b></nobr> "
-                 "from the machine <b>%3</b>.")
-                 .arg (mediumToAccusative (aMedium.type(), aMedium.isHostDrive()))
-                 .arg (aMedium.isHostDrive() ? aMedium.name() : aMedium.location())
-                 .arg (CMachine (aMachine).GetName()),
-             formatErrorInfo (aMachine));
+    QString text;
+    if (aMount)
+    {
+        text = tr ("Unable to mount the %1 <nobr><b>%2</b></nobr> to the machine <b>%3</b>.");
+        if (aRetry) text += tr (" Would you like to forcedly mount this medium?");
+    }
+    else
+    {
+        text = tr ("Unable to unmount the %1 <nobr><b>%2</b></nobr> from the machine <b>%3</b>.");
+        if (aRetry) text += tr (" Would you like to forcedly unmount this medium?");
+    }
+    if (aRetry)
+    {
+        return messageOkCancel (aParent, Question, text
+            .arg (mediumToAccusative (aMedium.type(), aMedium.isHostDrive()))
+            .arg (aMedium.isHostDrive() ? aMedium.name() : aMedium.location())
+            .arg (CMachine (aMachine).GetName()),
+            formatErrorInfo (aMachine),
+            0 /* Auto Confirm ID */,
+            tr ("Force Unmount"));
+    }
+    else
+    {
+        return message (aParent, Error, text
+            .arg (mediumToAccusative (aMedium.type(), aMedium.isHostDrive()))
+            .arg (aMedium.isHostDrive() ? aMedium.name() : aMedium.location())
+            .arg (CMachine (aMachine).GetName()),
+            formatErrorInfo (aMachine));
+    }
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp	(revision 24556)
+++ trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp	(revision 24557)
@@ -110,5 +110,5 @@
         QIAbstractWizard::accept();
     else
-        vboxProblem().cannotMountMedium (this, mMachine, vboxGlobal().findMedium (mCbMedia->id()));
+        vboxProblem().cannotRemountMedium (this, mMachine, vboxGlobal().findMedium (mCbMedia->id()), true /* mount? */, false /* retry? */);
 }
 
