I want to create a vagrant machine that automatically adds itself to the group "Vagrant" in my virtualbox mac installation. The group is already created. I add the following lines in the "Vagrantfile" but it fails:
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--groups", "Vagrant"]
end
This is the output:
fbarbeira@station:~/VagrantLab$ vagrant up precise
Bringing machine 'precise' up with 'virtualbox' provider...
[precise] Importing base box 'precise64'...
[precise] Matching MAC address for NAT networking...
[precise] Setting the name of the VM...
[precise] Clearing any previously set forwarded ports...
[precise] Creating shared folders metadata...
[precise] Clearing any previously set network interfaces...
[precise] Preparing network interfaces based on configuration...
[precise] Forwarding ports...
[precise] -- 22 => 2222 (adapter 1)
[precise] Running 'pre-boot' VM customizations...
A customization command failed:
["modifyvm", "910a92bd-35e3-43d4-9c13-2b4adfea5cd9", "--groups", "Vagrant"]
The following error was experienced:
VBoxManage: error: Invalid machine group 'Vagrant'
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBox, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "COMSETTER(Groups)(ComSafeArrayAsInParam(groups))" at line 485 of file VBoxManageModifyVM.cpp
Please fix this customization and try again.
fbarbeira@station:~/VagrantLab$