Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 5612)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 5613)
@@ -1355,26 +1355,30 @@
 
 #ifdef VBOX_WITH_EHCI
-            rc = CFGMR3InsertNode(pDevices, "usb-ehci", &pDev);                         RC_CHECK();
-            rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
-            rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
-            rc = CFGMR3InsertInteger(pInst, "Trusted",              1); /* boolean */   RC_CHECK();
-            rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo",          11);                RC_CHECK();
-            Assert(!faPciDeviceNo[11]);
-            faPciDeviceNo[11] = true;
-            rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",        0);                 RC_CHECK();
-
-            rc = CFGMR3InsertNode(pInst,    "LUN#0", &pLunL0);                          RC_CHECK();
-            rc = CFGMR3InsertString(pLunL0, "Driver",               "VUSBRootHub");     RC_CHECK();
-            rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
-
-            /*
-             * Attach the status driver.
-             */
-            rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                        RC_CHECK();
-            rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");      RC_CHECK();
-            rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
-            rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapUSBLed);RC_CHECK();
-            rc = CFGMR3InsertInteger(pCfg,  "First",    0);                             RC_CHECK();
-            rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                             RC_CHECK();
+            hrc = USBCtlPtr->COMGETTER(EnabledEhci)(&fEnabled);                         H();
+            if (fEnabled)
+            {
+                rc = CFGMR3InsertNode(pDevices, "usb-ehci", &pDev);                         RC_CHECK();
+                rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
+                rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
+                rc = CFGMR3InsertInteger(pInst, "Trusted",              1); /* boolean */   RC_CHECK();
+                rc = CFGMR3InsertInteger(pInst, "PCIDeviceNo",          11);                RC_CHECK();
+                Assert(!faPciDeviceNo[11]);
+                faPciDeviceNo[11] = true;
+                rc = CFGMR3InsertInteger(pInst, "PCIFunctionNo",        0);                 RC_CHECK();
+
+                rc = CFGMR3InsertNode(pInst,    "LUN#0", &pLunL0);                          RC_CHECK();
+                rc = CFGMR3InsertString(pLunL0, "Driver",               "VUSBRootHub");     RC_CHECK();
+                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
+
+                /*
+                 * Attach the status driver.
+                 */
+                rc = CFGMR3InsertNode(pInst,    "LUN#999", &pLunL0);                        RC_CHECK();
+                rc = CFGMR3InsertString(pLunL0, "Driver",               "MainStatus");      RC_CHECK();
+                rc = CFGMR3InsertNode(pLunL0,   "Config", &pCfg);                           RC_CHECK();
+                rc = CFGMR3InsertInteger(pCfg,  "papLeds", (uintptr_t)&pConsole->mapUSBLed);RC_CHECK();
+                rc = CFGMR3InsertInteger(pCfg,  "First",    0);                             RC_CHECK();
+                rc = CFGMR3InsertInteger(pCfg,  "Last",     0);                             RC_CHECK();
+            }
 #endif
         }
Index: /trunk/src/VBox/Main/USBControllerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 5612)
+++ /trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 5613)
@@ -241,4 +241,46 @@
 }
 
+STDMETHODIMP USBController::COMGETTER(EnabledEhci) (BOOL *aEnabled)
+{
+    if (!aEnabled)
+        return E_POINTER;
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    AutoReaderLock alock (this);
+
+    *aEnabled = mData->mEnabledEhci;
+
+    return S_OK;
+}
+
+STDMETHODIMP USBController::COMSETTER(EnabledEhci) (BOOL aEnabled)
+{
+    LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
+
+    AutoCaller autoCaller (this);
+    CheckComRCReturnRC (autoCaller.rc());
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep (mParent);
+    CheckComRCReturnRC (adep.rc());
+
+    AutoLock alock (this);
+
+    if (mData->mEnabledEhci != aEnabled)
+    {
+        mData.backup();
+        mData->mEnabledEhci = aEnabled;
+
+        /* leave the lock for safety */
+        alock.leave();
+
+        mParent->onUSBControllerChange();
+    }
+
+    return S_OK;
+}
+
 STDMETHODIMP USBController::COMGETTER(USBStandard) (USHORT *aUSBStandard)
 {
@@ -251,4 +293,5 @@
     /* not accessing data -- no need to lock */
 
+    /** Note: This is no longer correct */
     *aUSBStandard = 0x0101;
 
Index: /trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 5612)
+++ /trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 5613)
@@ -7726,4 +7726,13 @@
     </attribute>
 
+    <attribute name="enabledEhci" type="boolean">
+      <desc>
+        Flag whether the USB EHCI controller is present in the
+        guest system. If disabled, the virtual guest hardware will
+        not contain a USB EHCI controller. Can only be changed when
+        the VM is powered off. 
+      </desc>
+    </attribute>
+
     <attribute name="USBStandard" type="unsigned short" readonly="yes">
       <desc>
Index: /trunk/src/VBox/Main/include/USBControllerImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/USBControllerImpl.h	(revision 5612)
+++ /trunk/src/VBox/Main/include/USBControllerImpl.h	(revision 5613)
@@ -47,13 +47,16 @@
     {
         /* Constructor. */
-        Data() : mEnabled (FALSE) { }
+        Data() : mEnabled (FALSE), mEnabledEhci (FALSE) { }
 
         bool operator== (const Data &that) const
         {
-            return this == &that || mEnabled == that.mEnabled;
+            return this == &that || (mEnabled == that.mEnabled && mEnabledEhci == that.mEnabledEhci);
         }
 
         /** Enabled indicator. */
         BOOL mEnabled;
+
+        /** Enabled indicator for EHCI. */
+        BOOL mEnabledEhci;
     };
 
@@ -87,4 +90,6 @@
     STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
     STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
+    STDMETHOD(COMGETTER(EnabledEhci)) (BOOL *aEnabled);
+    STDMETHOD(COMSETTER(EnabledEhci)) (BOOL aEnabled);
     STDMETHOD(COMGETTER(USBStandard)) (USHORT *aUSBStandard);
     STDMETHOD(COMGETTER(DeviceFilters)) (IUSBDeviceFilterCollection **aDevicesFilters);
Index: /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
===================================================================
--- /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 5612)
+++ /trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd	(revision 5613)
@@ -534,4 +534,5 @@
   </xsd:sequence>
   <xsd:attribute name="enabled" type="xsd:boolean" use="required"/>
+  <xsd:attribute name="enabledEhci" type="xsd:boolean" default="false"/>
 </xsd:complexType>
 
