Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 57882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 57883)
@@ -232,4 +232,5 @@
 VBoxGlobal::VBoxGlobal()
     : mValid (false)
+    , m_fWrappersValid(false)
     , m_fVBoxSVCAvailable(true)
     , m_fSeparateProcess(false)
@@ -4022,4 +4023,6 @@
     m_host = virtualBox().GetHost();
     m_strHomeFolder = virtualBox().GetHomeFolder();
+    /* Mark wrappers valid: */
+    m_fWrappersValid = true;
 
     /* Watch for the VBoxSVC availability changes: */
@@ -4379,4 +4382,9 @@
     UIUpdateManager::schedule();
 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
+
+#ifdef RT_OS_LINUX
+    /* Make sure no wrong USB mounted: */
+    checkForWrongUSBMounted();
+#endif /* RT_OS_LINUX */
 }
 
@@ -4467,4 +4475,37 @@
     /* Cache the new VBoxSVC availability value: */
     m_fVBoxSVCAvailable = fAvailable;
+
+    /* If VBoxSVC is not available: */
+    if (!m_fVBoxSVCAvailable)
+    {
+        /* Mark wrappers invalid: */
+        m_fWrappersValid = false;
+        /* Re-fetch corresponding CVirtualBox to restart VBoxSVC: */
+        // CVirtualBox is still NULL in current Main implementation,
+        // and this call do not restart anything, so we are waiting
+        // for subsequent event about VBoxSVC is available again.
+        m_vbox = virtualBoxClient().GetVirtualBox();
+    }
+    /* If VBoxSVC is available: */
+    else
+    {
+        if (!m_fWrappersValid)
+        {
+            /* Re-fetch corresponding objects/values: */
+            m_vbox = virtualBoxClient().GetVirtualBox();
+            m_host = virtualBox().GetHost();
+            m_strHomeFolder = virtualBox().GetHomeFolder();
+            /* Mark wrappers valid: */
+            m_fWrappersValid = true;
+
+            /* If that is Selector UI: */
+            if (!isVMConsoleProcess())
+            {
+                /* Recreate/show selector-window: */
+                UISelectorWindow::destroy();
+                UISelectorWindow::create();
+            }
+        }
+    }
 
     /* Notify listeners about the VBoxSVC availability change: */
@@ -4585,8 +4626,46 @@
 #endif /* VBOX_WITH_DEBUGGER_GUI */
 
-/** @fn vboxGlobal
- *
- *  Shortcut to the static VBoxGlobal::instance() method, for convenience.
- */
+bool VBoxGlobal::showUI()
+{
+    /* Load application settings: */
+    VBoxGlobalSettings appSettings = settings();
+
+    /* Show Selector UI: */
+    if (!isVMConsoleProcess())
+    {
+        /* Make sure Selector UI is permitted: */
+        if (appSettings.isFeatureActive("noSelector"))
+        {
+            msgCenter().cannotStartSelector();
+            return false;
+        }
+
+#ifdef VBOX_BLEEDING_EDGE
+        /* Show EXPERIMENTAL BUILD warning: */
+        msgCenter().showExperimentalBuildWarning();
+#else /* !VBOX_BLEEDING_EDGE */
+# ifndef DEBUG
+        /* Show BETA warning if necessary: */
+        const QString vboxVersion(vboxGlobal().virtualBox().GetVersion());
+        if (   vboxVersion.contains("BETA")
+            && gEDataManager->preventBetaBuildWarningForVersion() != vboxVersion)
+            msgCenter().showBetaBuildWarning();
+# endif /* !DEBUG */
+#endif /* !VBOX_BLEEDING_EDGE */
+
+        /* Create/show selector-window: */
+        UISelectorWindow::create();
+    }
+    /* Show Runtime UI: */
+    else
+    {
+        /* Make sure machine is started: */
+        if (!UIMachine::startMachine(vboxGlobal().managedVMUuid()))
+            return false;
+    }
+
+    /* True by default: */
+    return true;
+}
 
 bool VBoxGlobal::switchToMachine(CMachine &machine)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 57882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 57883)
@@ -191,4 +191,7 @@
     bool processArgs();
 
+    /** Shows UI. */
+    bool showUI();
+
     bool switchToMachine(CMachine &machine);
 
@@ -529,5 +532,7 @@
     QString m_strHomeFolder;
 
-    /** Holds the VBoxSVC availability value. */
+    /** Holds whether acquired COM wrappers are currently valid. */
+    bool m_fWrappersValid;
+    /** Holds whether VBoxSVC is currently available. */
     bool m_fVBoxSVCAvailable;
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 57882)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 57883)
@@ -21,50 +21,55 @@
 
 /* Qt includes: */
-# include <QLocale>
 # include <QMessageBox>
-# include <QTranslator>
 
 /* GUI includes: */
-# include "VBoxUtils.h"
 # include "VBoxGlobal.h"
 # include "UIMachine.h"
-# include "UIMessageCenter.h"
 # include "UISelectorWindow.h"
-# include "UIExtraDataManager.h"
 # include "UIModalWindowManager.h"
+# ifdef VBOX_WITH_HARDENING
+#  include "QIMessageBox.h"
+# endif /* VBOX_WITH_HARDENING */
 # ifdef Q_WS_MAC
+#  include "VBoxUtils.h"
 #  include "UICocoaApplication.h"
 # endif /* Q_WS_MAC */
 
 /* Other VBox includes: */
-# include <iprt/asm.h>
 # include <iprt/buildconfig.h>
-# include <iprt/initterm.h>
-# include <iprt/process.h>
 # include <iprt/stream.h>
-# include <iprt/system.h>
 # include <VBox/version.h>
+# ifdef VBOX_WITH_HARDENING
+#  include <VBox/sup.h>
+# else /* !VBOX_WITH_HARDENING */
+#  include <iprt/initterm.h>
+#  ifdef Q_WS_MAC
+#   include <iprt/asm.h>
+#  endif /* Q_WS_MAC */
+# endif /* !VBOX_WITH_HARDENING */
 # ifdef Q_WS_X11
 #  include <iprt/env.h>
 # endif /* Q_WS_X11 */
+
+#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
+/* Qt includes: */
+#ifdef Q_WS_X11
+# ifdef Q_OS_SOLARIS
+#  include <QPlastiqueStyle>
+# endif /* Q_OS_SOLARIS */
+# ifndef Q_OS_SOLARIS
+#  include <QFontDatabase>
+# endif /* !Q_OS_SOLARIS */
+#endif /* Q_WS_X11 */
+
+/* Other VBox includes: */
 #ifdef VBOX_WITH_HARDENING
-# include <VBox/sup.h>
-#endif /* VBOX_WITH_HARDENING */
-
-#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
-/* Qt includes: */
-#include <QCleanlooksStyle>
-#include <QPlastiqueStyle>
-#ifdef Q_WS_X11
-# include <QFontDatabase>
-#endif /* Q_WS_X11 */
-
-/* Other VBox includes: */
-#include <iprt/ctype.h>
-#include <VBox/err.h>
+# include <iprt/ctype.h>
+#else /* !VBOX_WITH_HARDENING */
+# include <VBox/err.h>
+#endif /* !VBOX_WITH_HARDENING */
 
 /* Other includes: */
-#include <cstdio>
 #ifdef Q_WS_MAC
 # include <dlfcn.h>
@@ -321,9 +326,9 @@
 extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char ** /*envp*/)
 {
+    /* Failed result initially: */
+    int iResultCode = 1;
+
     /* Start logging: */
     LogFlowFuncEnter();
-
-    /* Failed result initially: */
-    int iResultCode = 1;
 
     /* Simulate try-catch block: */
@@ -466,54 +471,14 @@
                 break;
 
-            /* Exit if VBoxGlobal was able to pre-process arguments: */
+            /* Exit if VBoxGlobal pre-processed arguments: */
             if (vboxGlobal().processArgs())
                 break;
 
-#ifdef RT_OS_LINUX
-            /* Make sure no wrong USB mounted: */
-            VBoxGlobal::checkForWrongUSBMounted();
-#endif /* RT_OS_LINUX */
-
-            /* Load application settings: */
-            VBoxGlobalSettings settings = vboxGlobal().settings();
-
-            /* VM console process: */
-            if (vboxGlobal().isVMConsoleProcess())
-            {
-                /* Make sure VM is started: */
-                if (!UIMachine::startMachine(vboxGlobal().managedVMUuid()))
-                    break;
-
-                /* Start application: */
-                iResultCode = a.exec();
-            }
-            /* VM selector process: */
-            else
-            {
-                /* Make sure VM selector is permitted: */
-                if (settings.isFeatureActive("noSelector"))
-                {
-                    msgCenter().cannotStartSelector();
-                    break;
-                }
-
-#ifdef VBOX_BLEEDING_EDGE
-                msgCenter().showExperimentalBuildWarning();
-#else /* VBOX_BLEEDING_EDGE */
-# ifndef DEBUG
-                /* Check for BETA version: */
-                const QString vboxVersion(vboxGlobal().virtualBox().GetVersion());
-                if (   vboxVersion.contains("BETA")
-                    && gEDataManager->preventBetaBuildWarningForVersion() != vboxVersion)
-                    msgCenter().showBetaBuildWarning();
-# endif /* !DEBUG */
-#endif /* !VBOX_BLEEDING_EDGE*/
-
-                /* Create/show selector window: */
-                UISelectorWindow::create();
-
-                /* Start application: */
-                iResultCode = a.exec();
-            }
+            /* Exit if VBoxGlobal is unable to show UI: */
+            if (!vboxGlobal().showUI())
+                break;
+
+            /* Start application: */
+            iResultCode = a.exec();
         }
         while (0);
