Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp	(revision 27300)
@@ -390,8 +390,36 @@
     /* Load extra-data settings: */
     {
-        /* Get 'fullscreen' attributes: */
-        QString strFullscreenSettings = machine.GetExtraData(VBoxDefs::GUI_Fullscreen);
-        if (strFullscreenSettings == "yes")
-            initialStateType = UIVisualStateType_Fullscreen;
+        /* Machine while saving own settings will save "yes" only for current
+         * visual representation mode if its differs from normal mode of course.
+         * But user can alter extra data manually in machine xml file and set there
+         * more than one visual representation mode flags. Shame on such user!
+         * There is no reason to enter in more than one visual representation mode
+         * at machine start, so we are chosing first of requested modes: */
+        bool fIsSomeExtendedModeChosen = false;
+
+        if (!fIsSomeExtendedModeChosen)
+        {
+            /* Test 'seamless' flag: */
+            QString strSeamlessSettings = machine.GetExtraData(VBoxDefs::GUI_Seamless);
+            if (strSeamlessSettings == "yes")
+            {
+                fIsSomeExtendedModeChosen = true;
+                /* We can't enter seamless mode initially,
+                 * so we should ask ui-session for that: */
+                uisession()->setSeamlessModeRequested(true);
+            }
+        }
+
+        if (!fIsSomeExtendedModeChosen)
+        {
+            /* Test 'fullscreen' flag: */
+            QString strFullscreenSettings = machine.GetExtraData(VBoxDefs::GUI_Fullscreen);
+            if (strFullscreenSettings == "yes")
+            {
+                fIsSomeExtendedModeChosen = true;
+                /* We can enter fullscreen mode initially: */
+                initialStateType = UIVisualStateType_Fullscreen;
+            }
+        }
     }
 }
@@ -404,5 +432,9 @@
     /* Save extra-data settings: */
     {
-        /* Set 'fullscreen' attributes: */
+        /* Set 'seamless' flag: */
+        machine.SetExtraData(VBoxDefs::GUI_Seamless, m_pVisualState &&
+                             m_pVisualState->visualStateType() == UIVisualStateType_Seamless ? "yes" : QString());
+
+        /* Set 'fullscreen' flag: */
         machine.SetExtraData(VBoxDefs::GUI_Fullscreen, m_pVisualState &&
                              m_pVisualState->visualStateType() == UIVisualStateType_Fullscreen ? "yes" : QString());
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 27300)
@@ -424,4 +424,5 @@
     , m_pRunningOrPausedActions(0)
     , m_fIsWindowsCreated(false)
+    , m_fIsMachineStarted(false)
     , m_fIsPreventAutoStart(false)
     , m_fIsPreventAutoClose(false)
@@ -476,5 +477,5 @@
 {
     /* If we are started already => just return: */
-    if (uisession()->isRunning() || uisession()->isPaused())
+    if (m_fIsMachineStarted || uisession()->isRunning() || uisession()->isPaused())
         return;
 
@@ -556,4 +557,7 @@
     vboxGlobal().showUpdateDialog(false /* force request? */);
 #endif
+
+    /* Remember what machine was started already: */
+    m_fIsMachineStarted = true;
 
     /* Warn listeners about machine was started: */
@@ -582,4 +586,10 @@
 }
 #endif /* Q_WS_MAC */
+
+void UIMachineLogic::prepareConnections()
+{
+    /* Connect common handlers: */
+    connect(this, SIGNAL(sigMachineStarted()), this, SLOT(sltCheckRequestedModes()));
+}
 
 void UIMachineLogic::prepareConsoleConnections()
@@ -951,4 +961,7 @@
     actionsPool()->action(UIActionIndex_Toggle_Seamless)->setEnabled(fIsSupportsSeamless);
 
+    /* Check if we should enter some extended mode: */
+    sltCheckRequestedModes();
+
     /* Check the GA version only in case of additions are active: */
     if (!fIsAdditionsActive)
@@ -1005,4 +1018,32 @@
 {
     vboxProblem().showRuntimeError(session().GetConsole(), fIsFatal, strErrorId, strMessage);
+}
+
+void UIMachineLogic::sltCheckRequestedModes()
+{
+    /* Do not try to enter extended mode if machine was not started yet: */
+    if (!m_fIsMachineStarted)
+        return;
+
+    /* If seamless mode is requested, supported and we are NOT currently in seamless mode: */
+    if (uisession()->isSeamlessModeRequested() &&
+        uisession()->isGuestSupportsSeamless() &&
+        visualStateType() != UIVisualStateType_Seamless)
+    {
+        uisession()->setSeamlessModeRequested(false);
+        QAction *pSeamlessModeAction = actionsPool()->action(UIActionIndex_Toggle_Seamless);
+        AssertMsg(!pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n"));
+        QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger()));
+    }
+    /* If seamless mode is NOT requested, NOT supported and we are currently in seamless mode: */
+    else if (!uisession()->isSeamlessModeRequested() &&
+             !uisession()->isGuestSupportsSeamless() &&
+             visualStateType() == UIVisualStateType_Seamless)
+    {
+        uisession()->setSeamlessModeRequested(true);
+        QAction *pSeamlessModeAction = actionsPool()->action(UIActionIndex_Toggle_Seamless);
+        AssertMsg(pSeamlessModeAction->isChecked(), ("Seamless action should not be triggered before us!\n"));
+        QTimer::singleShot(0, pSeamlessModeAction, SLOT(trigger()));
+    }
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 27300)
@@ -114,4 +114,5 @@
 
     /* Prepare helpers: */
+    virtual void prepareConnections();
     virtual void prepareConsoleConnections();
     virtual void prepareActionGroups();
@@ -132,4 +133,5 @@
     //virtual void cleanupActionGroups() {}
     //virtual void cleanupConsoleConnections() {}
+    //virtual void cleanupConnections() {}
 
 protected slots:
@@ -141,4 +143,7 @@
     virtual void sltUSBDeviceStateChange(const CUSBDevice &device, bool fIsAttached, const CVirtualBoxErrorInfo &error);
     virtual void sltRuntimeError(bool fIsFatal, const QString &strErrorId, const QString &strMessage);
+
+    /* Mode request watch dog: */
+    void sltCheckRequestedModes();
 
 private slots:
@@ -200,4 +205,5 @@
 
     bool m_fIsWindowsCreated : 1;
+    bool m_fIsMachineStarted : 1;
     bool m_fIsPreventAutoStart : 1;
     bool m_fIsPreventAutoClose : 1;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 27300)
@@ -538,4 +538,5 @@
     , m_fIsIgnoreRutimeMediumsChanging(false)
     , m_fIsGuestResizeIgnored(false)
+    , m_fIsSeamlessModeRequested(false)
     /* Guest additions flags: */
     , m_fIsGuestAdditionsActive(false)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h	(revision 27300)
@@ -97,4 +97,5 @@
     bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRutimeMediumsChanging; }
     bool isGuestResizeIgnored() const { return m_fIsGuestResizeIgnored; }
+    bool isSeamlessModeRequested() const { return m_fIsSeamlessModeRequested; }
 
     /* Guest additions state getters: */
@@ -124,4 +125,5 @@
     bool setPause(bool fOn);
     void setGuestResizeIgnored(bool fIsGuestResizeIgnored) { m_fIsGuestResizeIgnored = fIsGuestResizeIgnored; }
+    void setSeamlessModeRequested(bool fIsSeamlessModeRequested) { m_fIsSeamlessModeRequested = fIsSeamlessModeRequested; }
 
     /* Keyboard setters: */
@@ -201,4 +203,5 @@
     bool m_fIsIgnoreRutimeMediumsChanging : 1;
     bool m_fIsGuestResizeIgnored : 1;
+    bool m_fIsSeamlessModeRequested : 1;
 
     /* Guest additions flags: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp	(revision 27300)
@@ -132,4 +132,7 @@
     if (!isPreventAutoStart())
     {
+        /* Prepare common connections: */
+        prepareConnections();
+
         /* Prepare console connections: */
         prepareConsoleConnections();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp	(revision 27300)
@@ -57,4 +57,7 @@
     if (!isPreventAutoStart())
     {
+        /* Prepare common connections: */
+        prepareConnections();
+
         /* Prepare console connections: */
         prepareConsoleConnections();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp	(revision 27299)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp	(revision 27300)
@@ -125,4 +125,7 @@
     if (!isPreventAutoStart())
     {
+        /* Prepare common connections: */
+        prepareConnections();
+
         /* Prepare console connections: */
         prepareConsoleConnections();
