Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conifgure VBoxManage commands that require VM be running from Vagrantfile

There are several commands under the VBoxManage umbrella that require the guest machine already be running (e.g. controlvm, guestcontrol) but all the vbox configuration I see in the Vagrantfile happens before the machine has started.

Is there a way in the Vagrantfile to configure the machine after it has started?

like image 324
user2859458 Avatar asked Sep 16 '25 23:09

user2859458


1 Answers

The goal of vagrant is to abstract the creation of VM for multiple provider (including VirtualBox) it is not really to provide all manipulation of the VM afterwards and replace the VBoxManage -

If you need to run command after the VM has started and run it from Vagrantfile, I would suggest to look at the vagrant-triggers plugin which :

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.

like image 198
Frederic Henri Avatar answered Sep 19 '25 15:09

Frederic Henri