Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 51595)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 51596)
@@ -949,4 +949,10 @@
 }
 
+bool UIExtraDataManager::hidLedsSyncState(const QString &strID) const
+{
+    /* 'True' unless feature restricted: */
+    return !isFeatureRestricted(GUI_HidLedsSync, strID);
+}
+
 void UIExtraDataManager::sltExtraDataChange(QString strMachineID, QString strKey, QString strValue)
 {
@@ -982,10 +988,10 @@
         /* HID LEDs sync state changed (allowed if not restricted)? */
         if (strKey == GUI_HidLedsSync)
-            emit sigHIDLedsSyncStateChange(!isFeatureRestricted(strKey));
+            emit sigHidLedsSyncStateChange(!isFeatureRestricted(strKey, strMachineID));
 #ifdef Q_WS_MAC
         /* 'Dock icon' appearance changed (allowed if not restricted)? */
         else if (   strKey == GUI_RealtimeDockIconUpdateEnabled
                  || strKey == GUI_RealtimeDockIconUpdateMonitor)
-            emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey));
+            emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID));
 #endif /* Q_WS_MAC */
     }
Index: trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 51595)
+++ trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h	(revision 51596)
@@ -56,6 +56,6 @@
     void sigRuntimeUIShortcutChange();
 
-    /** Notifies about HID LED sync state change. */
-    void sigHIDLedsSyncStateChange(bool fEnabled);
+    /** Notifies about HID LEDs synchronization state change. */
+    void sigHidLedsSyncStateChange(bool fEnabled);
 
 #ifdef RT_OS_DARWIN
@@ -274,4 +274,7 @@
     bool passCADtoGuest(const QString &strID) const;
 
+    /** Returns whether VM should perform HID LEDs synchronization. */
+    bool hidLedsSyncState(const QString &strID) const;
+
 private slots:
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 51595)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 51596)
@@ -189,5 +189,4 @@
     sltAdditionsStateChanged();
     sltMouseCapabilityChanged();
-    sltSwitchKeyboardLedsToGuestLeds();
 
 #ifdef VBOX_WITH_DEBUGGER_GUI
@@ -196,4 +195,7 @@
 #endif /* VBOX_WITH_DEBUGGER_GUI */
 
+    /* Load settings: */
+    loadSettings();
+
     /* Retranslate logic part: */
     retranslateUi();
@@ -202,6 +204,6 @@
 void UIMachineLogic::cleanup()
 {
-    /* Deinitialization: */
-    sltSwitchKeyboardLedsToPreviousLeds();
+    /* Save settings: */
+    saveSettings();
 
 #ifdef VBOX_WITH_DEBUGGER_GUI
@@ -527,5 +529,5 @@
 void UIMachineLogic::sltHidLedsSyncStateChanged(bool fEnabled)
 {
-    m_isHidLedsSyncEnabled = fEnabled;
+    m_fIsHidLedsSyncEnabled = fEnabled;
 }
 
@@ -642,24 +644,6 @@
 #endif /* Q_WS_MAC */
     , m_pHostLedsState(NULL)
-    , m_isHidLedsSyncEnabled(false)
-{
-    /* Setup HID LEDs synchronization. */
-#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
-    /* Read initial extradata value. */
-    QString strHidLedsSyncSettings = session().GetMachine().GetExtraData(GUI_HidLedsSync);
-
-    /* If extra data GUI/HidLedsSync is not present in VM config or set
-     * to 1 then sync is enabled. Otherwise, it is disabled. */
-    if (strHidLedsSyncSettings.isEmpty() || strHidLedsSyncSettings == "1")
-        m_isHidLedsSyncEnabled = true;
-    else
-        m_isHidLedsSyncEnabled = false;
-
-    /* Subscribe to GUI_HidLedsSync extradata changes in order to
-     * be able to enable or disable feature dynamically. */
-    connect(gEDataManager, SIGNAL(sigHIDLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool)));
-#else
-    m_isHidLedsSyncEnabled = false;
-#endif
+    , m_fIsHidLedsSyncEnabled(false)
+{
 }
 
@@ -1084,4 +1068,22 @@
 #endif /* VBOX_WITH_DEBUGGER_GUI */
 
+void UIMachineLogic::loadSettings()
+{
+#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
+    /* Read cached extra-data value: */
+    m_fIsHidLedsSyncEnabled = gEDataManager->hidLedsSyncState(vboxGlobal().managedVMUuid());
+    /* Subscribe to extra-data changes to be able to enable/disable feature dynamically: */
+    connect(gEDataManager, SIGNAL(sigHidLedsSyncStateChange(bool)), this, SLOT(sltHidLedsSyncStateChanged(bool)));
+#endif /* Q_WS_MAC || Q_WS_WIN */
+    /* HID LEDs sync initialization: */
+    sltSwitchKeyboardLedsToGuestLeds();
+}
+
+void UIMachineLogic::saveSettings()
+{
+    /* HID LEDs sync deinitialization: */
+    sltSwitchKeyboardLedsToPreviousLeds();
+}
+
 #ifdef VBOX_WITH_DEBUGGER_GUI
 void UIMachineLogic::cleanupDebugger()
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 51595)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h	(revision 51596)
@@ -98,6 +98,6 @@
     virtual void notifyAbout3DOverlayVisibilityChange(bool fVisible);
 
-    /** Performs HID LEDs sync. */
-    bool isHidLedsSyncEnabled() { return m_isHidLedsSyncEnabled; };
+    /** Returns whether VM should perform HID LEDs synchronization. */
+    bool isHidLedsSyncEnabled() const { return m_fIsHidLedsSyncEnabled; }
 
 protected slots:
@@ -166,6 +166,8 @@
     virtual void prepareDebugger();
 #endif /* VBOX_WITH_DEBUGGER_GUI */
+    virtual void loadSettings();
 
     /* Cleanup helpers: */
+    virtual void saveSettings();
 #ifdef VBOX_WITH_DEBUGGER_GUI
     virtual void cleanupDebugger();
@@ -297,5 +299,7 @@
 
     void *m_pHostLedsState;
-    bool m_isHidLedsSyncEnabled;
+
+    /** Holds whether VM should perform HID LEDs synchronization. */
+    bool m_fIsHidLedsSyncEnabled;
 
     /* Friend classes: */
