Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45274)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45275)
@@ -409,8 +409,12 @@
 }
 
-void UIMessageCenter::cannotOpenSession(const CVirtualBox &vbox, const CMachine &machine,
+void UIMessageCenter::cannotOpenSession(const CMachine &machine,
                                         const CProgress &progress /* = CProgress() */)
 {
-    Assert(!vbox.isOk() || progress.isOk());
+    /* Format error-info: */
+    Assert(!machine.isOk() || !progress.isNull());
+    QString strErrorInfo = !machine.isOk() ? formatErrorInfo(machine) :
+                           !progress.isOk() ? formatErrorInfo(progress) :
+                           formatErrorInfo(progress.GetErrorInfo());
     /* Compose machine name: */
     QString strName = machine.GetName();
@@ -420,19 +424,5 @@
     message(mainWindowShown(), MessageType_Error,
             tr("Failed to open a session for the virtual machine <b>%1</b>.").arg(strName),
-            !vbox.isOk() ? formatErrorInfo(vbox) : formatErrorInfo(progress.GetErrorInfo()));
-}
-
-void UIMessageCenter::cannotOpenSession(const CMachine &machine)
-{
-    /* Preserve error-info: */
-    COMResult res(machine);
-    /* Compose machine name: */
-    QString strName = machine.GetName();
-    if (strName.isEmpty())
-        strName = QFileInfo(machine.GetSettingsFilePath()).baseName();
-    /* Show the message: */
-    message(mainWindowShown(), MessageType_Error,
-            tr("Failed to open a session for the virtual machine <b>%1</b>.").arg(strName),
-            formatErrorInfo(res));
+            strErrorInfo);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45274)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45275)
@@ -205,6 +205,5 @@
     void cannotFindMachineById(const CVirtualBox &vbox, const QString &strId);
     void cannotOpenSession(const CSession &session);
-    void cannotOpenSession(const CVirtualBox &vbox, const CMachine &machine, const CProgress &progress = CProgress());
-    void cannotOpenSession(const CMachine &machine);
+    void cannotOpenSession(const CMachine &machine, const CProgress &progress = CProgress());
     void cannotGetMediaAccessibility(const UIMedium &medium);
     void cannotOpenURL(const QString &strUrl);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45274)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45275)
@@ -1749,10 +1749,4 @@
     {
         msgCenter().cannotOpenSession(machine);
-        session.detach();
-        return session;
-    }
-    else if (!mVBox.isOk())
-    {
-        msgCenter().cannotOpenSession(mVBox, machine);
         session.detach();
         return session;
@@ -4915,7 +4909,9 @@
 bool VBoxGlobal::launchMachine(CMachine &machine, bool fHeadless /* = false */)
 {
+    /* Switch to machine window(s) if possible: */
     if (machine.CanShowConsoleWindow())
         return VBoxGlobal::switchToMachine(machine);
 
+    /* Make sure machine-state is one of required: */
     KMachineState state = machine.GetState(); NOREF(state);
     AssertMsg(   state == KMachineState_PoweredOff
@@ -4923,7 +4919,7 @@
               || state == KMachineState_Teleported
               || state == KMachineState_Aborted
-              , ("Machine must be PoweredOff/Saved/Aborted (%d)", state));
-
-    CVirtualBox vbox = vboxGlobal().virtualBox();
+              , ("Machine must be PoweredOff/Saved/Teleported/Aborted (%d)", state));
+
+    /* Create empty session instance: */
     CSession session;
     session.createInstance(CLSID_Session);
@@ -4934,38 +4930,41 @@
     }
 
-#if defined(Q_OS_WIN32)
-    /* allow the started VM process to make itself the foreground window */
+    /* Configure environment: */
+    QString strEnv;
+#ifdef Q_OS_WIN
+    /* Allow started VM process to be foreground window: */
     AllowSetForegroundWindow(ASFW_ANY);
-#endif
-
-    QString env;
-#if defined(Q_WS_X11)
-    /* make sure the VM process will start on the same display as the Selector */
-    const char *display = RTEnvGet("DISPLAY");
-    if (display)
-        env.append(QString("DISPLAY=%1\n").arg(display));
-    const char *xauth = RTEnvGet("XAUTHORITY");
-    if (xauth)
-        env.append(QString("XAUTHORITY=%1\n").arg(xauth));
-#endif
+#endif /* Q_OS_WIN */
+#ifdef Q_WS_X11
+    /* Make sure VM process will start on the same display as the VM selector: */
+    const char *pDisplay = RTEnvGet("DISPLAY");
+    if (pDisplay)
+        strEnv.append(QString("DISPLAY=%1\n").arg(pDisplay));
+    const char *pXauth = RTEnvGet("XAUTHORITY");
+    if (pXauth)
+        strEnv.append(QString("XAUTHORITY=%1\n").arg(pXauth));
+#endif /* Q_WS_X11 */
     const QString strType = fHeadless ? "headless" : "";
 
-    CProgress progress = machine.LaunchVMProcess(session, strType, env);
-    if (   !vbox.isOk()
-        || progress.isNull())
-    {
-        msgCenter().cannotOpenSession(vbox, machine);
+    /* Prepare "VM spawning" progress: */
+    CProgress progress = machine.LaunchVMProcess(session, strType, strEnv);
+    if (!machine.isOk())
+    {
+        msgCenter().cannotOpenSession(machine);
         return false;
     }
 
-    /* Hide the "VM spawning" progress dialog */
-    /* I hope 1 minute will be enough to spawn any running VM silently, isn't it? */
+    /* Postpone showing "VM spawning" progress.
+     * Hope 1 minute will be enough to spawn any running VM silently,
+     * otherwise we better show the progress... */
     int iSpawningDuration = 60000;
     msgCenter().showModalProgressDialog(progress, machine.GetName(), "", mainWindow(), iSpawningDuration);
     if (progress.GetResultCode() != 0)
-        msgCenter().cannotOpenSession(vbox, machine, progress);
-
+        msgCenter().cannotOpenSession(machine, progress);
+
+    /* Unlock machine, close session: */
     session.UnlockMachine();
 
+    /* True finally: */
     return true;
 }
