Index: /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 59909)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 59910)
@@ -519,4 +519,11 @@
                 break;
 
+            /* For Runtime UI: */
+            if (vboxGlobal().isVMConsoleProcess())
+            {
+                /* Prevent application from exiting when all window(s) closed: */
+                qApp->setQuitOnLastWindowClosed(false);
+            }
+
             /* Request to Show UI _after_ QApplication started: */
             QMetaObject::invokeMethod(&vboxGlobal(), "showUI", Qt::QueuedConnection);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 59909)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 59910)
@@ -201,7 +201,4 @@
         return false;
 
-    /* Prevent application from closing when all window(s) closed: */
-    qApp->setQuitOnLastWindowClosed(false);
-
     /* Cache medium data early if necessary: */
     if (vboxGlobal().agressiveCaching())
