Vagrant config

27 views
Skip to first unread message

Makrand

unread,
Nov 22, 2017, 7:38:26 AM11/22/17
to Vagrant
Hello,

Getting started with vagrant.

Right now I am playing with hashicorp/precise64 box

The only thing I defined in vagrant file is name of box and kept rest file (created with vagrant init) as is. The VM is getting launched by default into /home/user/Virtualbox VMs folder. (Since this folder in on SSD, do not want to use if for testing purposes)

1) Is there any way can force VM to be launched into particular folder?? say /media/mount/VMs.

2) Where can I define the cpu core/ghz and root disk size parameters for VM? 


Alvaro Miranda Aguilera

unread,
Nov 22, 2017, 8:28:32 AM11/22/17
to vagra...@googlegroups.com
hello

yes

1. you can open virtualbox GUI, go to settings and replace the default location for vms.

2. you can update the vagrantfile to modify the VM to adjust memory and CPU count.

ghz not sure, say your machine is 2ghz you can set some sort of cpu caps on utilization


cpu cap:


memory and cpu:

config.vm.provider "virtualbox" do |v|
  v.memory = 1024
  v.cpus = 2
end

Thanks
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/fa8f1e76-762e-4e1d-aa23-8eb57c194853%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Makrand

unread,
Nov 23, 2017, 6:01:37 AM11/23/17
to vagra...@googlegroups.com
Hi,

Thanks a lot. 

for CPU ghz did below

   config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #    Customize the CPU/RAM on the VM:
     vb.memory = "512"
     vb.cpus = 1
     vb.name = "pilot-vm"
  #  Cap cpu limit at 50%. So it can be 1ghz cpu
     vb.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]

     end

It just shows original ghz of native cpu at OS (and not 1ghz), but at Vbox GUI you can see cpu capped at 50%. So its 1ghz roughly.


BTW, 

1) how can I customize the size of disk? by default its creating 80GB of disk (I know its dynamically allocated, but it would still be nice to have this parameter defined)
2) Any glossary/index page which lists config parameters that we defined for each bit.





--
Makrand


You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/xjsNZh0S7HI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exBpTs%3D-59-DPSwVae4h3avAm65%2Bf0FwNFeNnrrrug%2BNw%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
Nov 23, 2017, 9:37:11 AM11/23/17
to vagra...@googlegroups.com
hello

for 1, nope, chicken egg situation.

better build a new base box that is suit for the task. check packer.io for a tool to build base boxes.

for 2.

Check virtualbox documentation, cpu/memory are just in alias, but all the config are like this:

vb.customize ["modifyvm",..

that is like running VBoxManage modifyvm

so at command line you can do VBoxManage modifyvm --help or something, or just check VirtualBox documentation online

Thanks!
Alvaro


For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages