Using trickle to limit the bandwidth of a VirtualBox VM
Solution 1:
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