Set bandwidthlimit for VM

80 views
Skip to first unread message

Rouven Hoffmann

unread,
Aug 26, 2015, 8:50:31 AM8/26/15
to Vagrant
Hi,

I want to set a bandwithlimit for a networkinterface in one of my VMs.
I know that VirtualBox provides this function and it works for me if I do it manually with the following commands:
  • VBoxManage bandwidthctl "Client" add Limit --type network --limit 200k
  • VBoxManage modifyvm "Client" --nicbandwidthgroup1 Limit

Now my question is if I can do the same configuration within my Vagrantfile.


Kindly regards


Alvaro Miranda Aguilera

unread,
Aug 26, 2015, 7:10:27 PM8/26/15
to vagra...@googlegroups.com
On Thu, Aug 27, 2015 at 12:50 AM, Rouven Hoffmann
<grouv...@googlemail.com> wrote:
> VBoxManage bandwidthctl "Client" add Limit --type network --limit 200k
> VBoxManage modifyvm "Client" --nicbandwidthgroup1 Limit


Hello,

From the documentation:
https://docs.vagrantup.com/v2/virtualbox/configuration.html

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
end

So you should be able to do:

config.vm.provider "virtualbox" do |v|
v.customize ["bandwidthctl", :id, "add", "Limit", "--type",
"network", "--limit", "200k"]
v.customize ["modifyvm", :id, "--nicbandwidthgroup1", "Limit"]
end

Hope this helps
Alvaro.
Reply all
Reply to author
Forward
0 new messages