Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 46598)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 46599)
@@ -810,5 +810,5 @@
             this, SLOT(sltOpenSharedFoldersDialog()));
     connect(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer), SIGNAL(toggled(bool)),
-            this, SLOT(sltSwitchVrde(bool)));
+            this, SLOT(sltToggleVRDE(bool)));
     connect(gActionPool->action(UIActionIndexRuntime_Toggle_VideoCapture), SIGNAL(toggled(bool)),
             this, SLOT(sltToggleVideoCapture(bool)));
@@ -1890,19 +1890,47 @@
 }
 
-void UIMachineLogic::sltSwitchVrde(bool fOn)
-{
-    /* Prepare variables: */
+void UIMachineLogic::sltToggleVRDE(bool fEnabled)
+{
+    /* Do not process if window(s) missed! */
+    if (!isMachineWindowsCreated())
+        return;
+
+    /* Access VRDE server: */
     CMachine machine = session().GetMachine();
     CVRDEServer server = machine.GetVRDEServer();
-    AssertMsg(!server.isNull(), ("VRDE server should not be null!\n"));
-
-    /* Toggle VRDE server state: */
-    server.SetEnabled(fOn);
-    if (!server.isOk())
-    {
-        /* Notify about the error: */
-        msgCenter().cannotToggleVRDEServer(server, machine.GetName(), fOn);
-        /* Make sure action is updated! */
-        uisession()->updateStatusVRDE();
+    AssertMsg(!server.isNull(), ("VRDE server should NOT be null!\n"));
+    if (!machine.isOk() || server.isNull())
+        return;
+
+    /* Make sure something had changed: */
+    if (server.GetEnabled() == static_cast<BOOL>(fEnabled))
+        return;
+
+    /* Server is OK? */
+    if (server.isOk())
+    {
+        /* Update VRDE server state: */
+        server.SetEnabled(fEnabled);
+        /* Server still OK? */
+        if (server.isOk())
+        {
+            /* Save machine-settings: */
+            machine.SaveSettings();
+            /* Machine still OK? */
+            if (!machine.isOk())
+            {
+                /* Notify about the error: */
+                msgCenter().cannotSaveMachineSettings(machine);
+                /* Make sure action is updated! */
+                uisession()->updateStatusVRDE();
+            }
+        }
+        else
+        {
+            /* Notify about the error: */
+            msgCenter().cannotToggleVRDEServer(server, machine.GetName(), fEnabled);
+            /* Make sure action is updated! */
+            uisession()->updateStatusVRDE();
+        }
     }
 }
@@ -1933,5 +1961,5 @@
     /* Machine had failed on one of steps? */
     if (!machine.isOk())
-        msgCenter().cannotSaveMachineSettings(machine, activeMachineWindow());
+        msgCenter().cannotSaveMachineSettings(machine);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 46598)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 46599)
@@ -205,5 +205,5 @@
     void sltPrepareDragAndDropMenu();
     void sltChangeDragAndDropType(QAction *pAction);
-    void sltSwitchVrde(bool fOn);
+    void sltToggleVRDE(bool fEnabled);
     void sltToggleVideoCapture(bool fEnabled);
     void sltOpenVideoCaptureOptions();
