Ubuntu – Using trickle to limit the bandwidth of a VirtualBox VM


I'm trying to limit the bandwidth of a virtual machine running via VirtualBox.

trickle -d 5 virtualbox doesn't work, I believe because of an issue with child processes
(trickle -d 5 sudo apt-get upgrade doesn't work either)

How can I limit the download/upload bandwidth of VirtualBox's VMs?

Best Answer

VirtualBox has bandwidth limiting that you can enable via VboxManage.
See http://www.virtualbox.org/manual/ch06.html#network_bandwidth_limit

Limits are configured through VBoxManage. The example below creates a bandwidth group named "Limit", sets the limit to 20 Mbit/s and assigns the group to the first and second adapters of the VM:

   VBoxManage bandwidthctl "VM name" add Limit --type network --limit 20m
   VBoxManage modifyvm "VM name" --nicbandwidthgroup1 Limit
   VBoxManage modifyvm "VM name" --nicbandwidthgroup2 Limit
Related Question