Index: trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp	(revision 89585)
@@ -74,4 +74,20 @@
     if (pWidget)
         pWidget->setDialogBeingClosed(true);
+}
+
+void UIVMLogViewerDialog::setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items)
+{
+    Q_UNUSED(items);
+    UIVMLogViewerWidget *pLogViewerWidget = qobject_cast<UIVMLogViewerWidget*>(widget());
+    if (pLogViewerWidget)
+        pLogViewerWidget->setSelectedVMListItems(items);
+}
+
+void UIVMLogViewerDialog::addSelectedVMListItems(const QList<UIVirtualMachineItem*> &items)
+{
+    Q_UNUSED(items);
+    UIVMLogViewerWidget *pLogViewerWidget = qobject_cast<UIVMLogViewerWidget*>(widget());
+    if (pLogViewerWidget)
+        pLogViewerWidget->addSelectedVMListItems(items);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h	(revision 89585)
@@ -40,4 +40,5 @@
 class UIActionPool;
 class UIVMLogViewerDialog;
+class UIVirtualMachineItem;
 class CMachine;
 
@@ -79,4 +80,6 @@
     UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine);
     ~UIVMLogViewerDialog();
+    void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
+    void addSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
 
 protected:
Index: trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp	(revision 89585)
@@ -222,4 +222,17 @@
 }
 
+void UIVMLogViewerWidget::addSelectedVMListItems(const QList<UIVirtualMachineItem*> &items)
+{
+    QVector<QUuid> selectedMachines(m_machines);
+
+    foreach (const UIVirtualMachineItem *item, items)
+    {
+        if (!item)
+            continue;
+        selectedMachines << item->id();
+    }
+    setMachines(selectedMachines);
+}
+
 void UIVMLogViewerWidget::setMachines(const QVector<QUuid> &machineIDs)
 {
@@ -960,5 +973,5 @@
         QString strMachineName = comMachine.GetName();
 
-        if (m_enmEmbedding == EmbedTo_Stack)
+        if (uiCommon().uiType() == UICommon::UIType_SelectorUI)
             m_pTabWidget->addTab(new UILabelTab(this, uMachineId), strMachineName);
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h	(revision 89585)
@@ -88,4 +88,5 @@
 
     void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
+    void addSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
     QFont currentFont() const;
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 89585)
@@ -467,4 +467,6 @@
     , m_fFirstMediumEnumerationHandled(false)
     , m_pActionPool(0)
+    , m_pLogViewerDialog(0)
+    , m_pWidget(0)
     , m_iGeometrySaveTimerId(-1)
 {
@@ -2001,4 +2003,6 @@
     }
 
+    QList<UIVirtualMachineItem*> itemsToShowLogs;
+
     /* For each selected item: */
     foreach (UIVirtualMachineItem *pItem, items)
@@ -2012,72 +2016,36 @@
         if (!isActionEnabled(UIActionIndexMN_M_Group_S_ShowLogDialog, QList<UIVirtualMachineItem*>() << pItem))
             continue;
-
-        QIManagerDialog *pLogViewerDialog = 0;
-        /* Create and Show VM Log Viewer: */
-        if (!m_logViewers[pItemLocal->machine().GetHardwareUUID().toString()])
-        {
-            UIVMLogViewerDialogFactory dialogFactory(actionPool(), pItemLocal->machine());
-            dialogFactory.prepare(pLogViewerDialog, this);
-            if (pLogViewerDialog)
-            {
-                m_logViewers[pItemLocal->machine().GetHardwareUUID().toString()] = pLogViewerDialog;
-                connect(pLogViewerDialog, &QIManagerDialog::sigClose,
-                        this, &UIVirtualBoxManager::sltCloseLogViewerWindow);
-            }
-        }
-        else
-        {
-            pLogViewerDialog = m_logViewers[pItemLocal->machine().GetHardwareUUID().toString()];
-        }
-        if (pLogViewerDialog)
-        {
-            /* Show instance: */
-            pLogViewerDialog->show();
-            pLogViewerDialog->setWindowState(pLogViewerDialog->windowState() & ~Qt::WindowMinimized);
-            pLogViewerDialog->activateWindow();
-        }
-    }
+        itemsToShowLogs << pItem;
+    }
+
+    if (itemsToShowLogs.isEmpty())
+        return;
+    if (!m_pLogViewerDialog)
+    {
+        UIVMLogViewerDialogFactory dialogFactory(actionPool(), CMachine());
+        dialogFactory.prepare(m_pLogViewerDialog, this);
+        if (m_pLogViewerDialog)
+            connect(m_pLogViewerDialog, &QIManagerDialog::sigClose,
+                    this, &UIVirtualBoxManager::sltCloseLogViewerWindow);
+    }
+    AssertPtrReturnVoid(m_pLogViewerDialog);
+    UIVMLogViewerDialog *pDialog = qobject_cast<UIVMLogViewerDialog*>(m_pLogViewerDialog);
+    if (pDialog)
+        pDialog->addSelectedVMListItems(itemsToShowLogs);
+    m_pLogViewerDialog->show();
+    m_pLogViewerDialog->setWindowState(m_pLogViewerDialog->windowState() & ~Qt::WindowMinimized);
+    m_pLogViewerDialog->activateWindow();
 }
 
 void UIVirtualBoxManager::sltCloseLogViewerWindow()
 {
-    /* If there is a proper sender: */
-    if (qobject_cast<QIManagerDialog*>(sender()))
-    {
-        /* Search for the sender of the signal within the m_logViewers map: */
-        QMap<QString, QIManagerDialog*>::iterator sendersIterator = m_logViewers.begin();
-        while (sendersIterator != m_logViewers.end() && sendersIterator.value() != sender())
-            ++sendersIterator;
-        /* Do nothing if we cannot find it with the map: */
-        if (sendersIterator == m_logViewers.end())
-            return;
-
-        /* Check whether we have found the proper dialog: */
-        QIManagerDialog *pDialog = qobject_cast<QIManagerDialog*>(sendersIterator.value());
-        if (!pDialog)
-            return;
-
-        /* First remove this log-viewer dialog from the map.
-         * This should be done before closing the dialog which will incur
-         * a second call to this function and result in double delete!!! */
-        m_logViewers.erase(sendersIterator);
-        UIVMLogViewerDialogFactory().cleanup(pDialog);
-    }
-    /* Otherwise: */
-    else
-    {
-        /* Just wipe out everything: */
-        foreach (const QString &strKey, m_logViewers.keys())
-        {
-            /* First remove each log-viewer dialog from the map.
-             * This should be done before closing the dialog which will incur
-             * a second call to this function and result in double delete!!! */
-            QIManagerDialog *pDialog = m_logViewers.value(strKey);
-            m_logViewers.remove(strKey);
-            UIVMLogViewerDialogFactory().cleanup(pDialog);
-        }
-    }
-}
-
+    if (!m_pLogViewerDialog)
+        return;
+
+    QIManagerDialog* pDialog = m_pLogViewerDialog;
+    m_pLogViewerDialog = 0;
+    pDialog->close();
+    UIVMLogViewerDialogFactory().cleanup(pDialog);
+}
 
 void UIVirtualBoxManager::sltPerformRefreshMachine()
Index: trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 89582)
+++ trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 89585)
@@ -44,5 +44,4 @@
 typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
 typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
-typedef QMap<QString, QIManagerDialog*> VMLogViewerMap;
 
 /** Singleton QMainWindow extension used as VirtualBox Manager instance. */
@@ -453,6 +452,6 @@
     QMap<UIToolType, QIManagerDialog*>  m_managers;
 
-    /** Holds a map of (machineUUID, UIVMLogViewerDialog). */
-    VMLogViewerMap   m_logViewers;
+    /** Holds the instance of UIVMLogViewerDialog. */
+    QIManagerDialog   *m_pLogViewerDialog;
 
     /** Holds the central-widget instance. */
