How can I create a VM in Vagrant with VirtualBox with two CPUs?

Add vb.customize [“modifyvm”, :id, “–ioapic”, “on”] to the config.vm.provider block inside your Vagrantfile. Looking at the VirtualBox documentation it mentions: “Note Enabling the I/O APIC is required for 64-bit guest operating systems, especially Windows Vista; it is also required if you want to use more than one virtual CPU in a virtual machine.”

Vagrant with VirtualBox on Windows10: “Rsync” could not be found on your PATH

I found in another forum that the local Vagrant directory is mounted as “/vagrant” via rsync. This is set in the box itself, you can check by opening C:\Users\{your_username}\.vagrant.d\boxes\debian-VAGRANTSLASH-jessie64\8.2.2\virtualbox\Vagrantfile and see the setting config.vm.synced_folder \ “.”, “/vagrant”, type: “rsync” to get around this I added the following line in my local Vagrantfile config.vm.synced_folder “.”, “/vagrant”, … Read more

Demand a Vagrant plugin within the Vagrantfile?

UPDATE Aug 31, 2018: See @Starx’s fix below for later versions of Vagrant (1.8 and above) Here is version based on Louis St. Amour’s solution together with Rob Kinyon’s comment about re-exec if a new plugin was installeed, I use it successfully in my own setup: required_plugins = %w(vagrant-share vagrant-vbguest…) plugins_to_install = required_plugins.select { |plugin| … Read more

Pass environment variables to vagrant shell provisioner

Since Vagrant 1.8.0 you can forget the ugly hacks from the other answers here. Just use the env option for the shell provisioner (docs). Use it like this in your Vagrantfile: config.vm.provision “shell”, path: “provisionscript.sh”, env: {“MYVAR” => “value”} This will set the environment for the provisioning script only. If you need a persistent environment … Read more

vagrant.d outside of the home folder

By default Vagrant uses ~/.vagrant.d. Fortunately, vagrant provides an environment variable called VAGRANT_HOME by which you can set vagrant home. Just do the following to change the vagrant home (this only works in the current session) export VAGRANT_HOME=/path/to/vagrant To make it permanent, add this to your ~/.bash_profile (for login shell). Update: VAGRANT_HOME has been added … Read more

Vagrant was unable to mount VirtualBox shared folders

Update Fixed in VirtualBox 5.1.22. (https://www.virtualbox.org/ticket/16670) Original answer In my case a symlink inside the VM was wrong. Log into the VM: $ vagrant ssh Then: $ ls -lh /sbin/mount.vboxsf lrwxrwxrwx 1 root root 49 Apr 19 14:05 /sbin/mount.vboxsf -> /opt/VBoxGuestAdditions-5.1.20/other/mount.vboxsf This link is broken. When you look inside /opt/VBoxGuestAdditions-5.1.20/ you see that the subfolder … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)