Index: /trunk/include/VBox/vmm/pdmnetshaper.h
===================================================================
--- /trunk/include/VBox/vmm/pdmnetshaper.h	(revision 40711)
+++ /trunk/include/VBox/vmm/pdmnetshaper.h	(revision 40712)
@@ -92,4 +92,14 @@
 VMMR3DECL(int) PDMR3NsDetach(PVM pVM, PPDMDRVINS pDrvIns, PPDMNSFILTER pFilter);
 
+/**
+ * Adjusts the maximum rate for the bandwidth group.
+ *
+ * @returns VBox status code.
+ * @param   pVM                   Handle of VM.
+ * @param   pcszBwGroup           Name of the bandwidth group to attach to.
+ * @param   cbTransferPerSecMax   Maximum number of bytes per second to be transmitted.
+ */
+VMMR3DECL(int) PDMR3NsBwGroupSetLimit(PVM pVM, const char *pcszBwGroup, uint32_t cbTransferPerSecMax);
+
 /** @} */
 
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 40711)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl.cpp	(revision 40712)
@@ -96,4 +96,7 @@
 # include <VBox/vmm/pdmusb.h>
 #endif
+#ifdef VBOX_WITH_NETSHAPER
+# include <VBox/vmm/pdmnetshaper.h>
+#endif /* VBOX_WITH_NETSHAPER */
 #include <VBox/vmm/mm.h>
 #include <VBox/vmm/ftm.h>
@@ -5152,13 +5155,22 @@
             ULONG cMax;
             Bstr strName;
+            BandwidthGroupType_T enmType;
             rc = aBandwidthGroup->COMGETTER(Name)(strName.asOutParam());
             if (SUCCEEDED(rc))
                 rc = aBandwidthGroup->COMGETTER(MaxMbPerSec)(&cMax);
+            if (SUCCEEDED(rc))
+                rc = aBandwidthGroup->COMGETTER(Type)(&enmType);
 
             if (SUCCEEDED(rc))
             {
-                int vrc;
-                vrc = PDMR3AsyncCompletionBwMgrSetMaxForFile(ptrVM, Utf8Str(strName).c_str(),
-                                                             cMax * _1M);
+                int vrc = VINF_SUCCESS;
+                if (enmType == BandwidthGroupType_Disk)
+                    vrc = PDMR3AsyncCompletionBwMgrSetMaxForFile(ptrVM, Utf8Str(strName).c_str(),
+                                                                 cMax * _1M);
+                else if (enmType == BandwidthGroupType_Network)
+                    vrc = PDMR3NsBwGroupSetLimit(ptrVM, Utf8Str(strName).c_str(),
+                                                                 cMax * 1000);
+                else
+                    rc = E_NOTIMPL;
                 AssertRC(vrc);
             }
Index: /trunk/src/VBox/VMM/VMMR3/PDMNetShaper.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/PDMNetShaper.cpp	(revision 40711)
+++ /trunk/src/VBox/VMM/VMMR3/PDMNetShaper.cpp	(revision 40712)
@@ -152,4 +152,13 @@
 #endif
 
+static void pdmNsBwGroupSetLimit(PPDMNSBWGROUP pBwGroup, uint32_t cbTransferPerSecMax)
+{
+    pBwGroup->cbTransferPerSecMax = cbTransferPerSecMax;
+    pBwGroup->cbBucketSize        = RT_MAX(PDM_NETSHAPER_MIN_BUCKET_SIZE,
+                                           cbTransferPerSecMax * PDM_NETSHAPER_MAX_LATENCY / 1000);
+    LogFlowFunc(("New rate limit is %d bytes per second, adjusted bucket size to %d bytes\n",
+                 pBwGroup->cbTransferPerSecMax, pBwGroup->cbBucketSize));
+}
+
 static int pdmNsBwGroupCreate(PPDMNETSHAPER pShaper, const char *pcszBwGroup, uint32_t cbTransferPerSecMax)
 {
@@ -179,7 +188,6 @@
                     pBwGroup->cRefs                 = 0;
 
-                    pBwGroup->cbTransferPerSecMax   = cbTransferPerSecMax;
-                    pBwGroup->cbBucketSize          = RT_MAX(PDM_NETSHAPER_MIN_BUCKET_SIZE,
-                                                             cbTransferPerSecMax * PDM_NETSHAPER_MAX_LATENCY / 1000);
+                    pdmNsBwGroupSetLimit(pBwGroup, cbTransferPerSecMax);
+;
                     pBwGroup->cbTokensLast          = pBwGroup->cbBucketSize;
                     pBwGroup->tsUpdatedLast         = RTTimeSystemNanoTS();
@@ -231,5 +239,5 @@
     {
         bool fChoked = ASMAtomicXchgBool(&pFilter->fChoked, false);
-        LogFlowFunc(("pFilter=%#p fChoked=%RTbool\n", pFilter, fChoked));
+        Log3((LOG_FN_FMT ": pFilter=%#p fChoked=%RTbool\n", __PRETTY_FUNCTION__, pFilter, fChoked));
         if (fChoked && pFilter->pIDrvNet)
         {
@@ -337,5 +345,5 @@
 }
 
-bool PDMR3NsAllocateBandwidth(PPDMNSFILTER pFilter, uint32_t cbTransfer)
+VMMR3DECL(bool) PDMR3NsAllocateBandwidth(PPDMNSFILTER pFilter, uint32_t cbTransfer)
 {
     AssertPtrReturn(pFilter, VERR_INVALID_POINTER);
@@ -363,8 +371,32 @@
 
     rc = RTCritSectLeave(&pBwGroup->cs); AssertRC(rc);
-    LogFlowFunc(("BwGroup=%#p{%s} cbTransfer=%u uTokens=%u uTokensAdded=%u fAllowed=%RTbool\n",
-                 pBwGroup, pBwGroup->pszName, cbTransfer, uTokens, uTokensAdded, fAllowed));
+    Log2((LOG_FN_FMT "BwGroup=%#p{%s} cbTransfer=%u uTokens=%u uTokensAdded=%u fAllowed=%RTbool\n",
+          __PRETTY_FUNCTION__, pBwGroup, pBwGroup->pszName, cbTransfer, uTokens, uTokensAdded, fAllowed));
     return fAllowed;
 }
+
+VMMR3DECL(int) PDMR3NsBwGroupSetLimit(PVM pVM, const char *pcszBwGroup, uint32_t cbTransferPerSecMax)
+{
+    PUVM pUVM = pVM->pUVM;
+    PPDMNETSHAPER pShaper = pUVM->pdm.s.pNetShaper;
+
+    int rc = RTCritSectEnter(&pShaper->cs); AssertRC(rc);
+    if (RT_SUCCESS(rc))
+    {
+        PPDMNSBWGROUP pBwGroup = pdmNsBwGroupFindById(pShaper, pcszBwGroup);
+        if (pBwGroup)
+        {
+            rc = RTCritSectEnter(&pBwGroup->cs); AssertRC(rc);
+            pdmNsBwGroupSetLimit(pBwGroup, cbTransferPerSecMax);
+            /* Drop extra tokens */
+            if (pBwGroup->cbTokensLast > pBwGroup->cbBucketSize)
+                pBwGroup->cbTokensLast = pBwGroup->cbBucketSize;
+            rc = RTCritSectLeave(&pBwGroup->cs); AssertRC(rc);
+        }
+        rc = RTCritSectLeave(&pShaper->cs); AssertRC(rc);
+    }
+    return rc;
+}
+
 
 /**
