Reputation: 28294
I had a dev setup the vagrant box and he uploaded the file which I now have on my local machine. But I am not sure how to use it as I never used vagrant before. Can someone help with the docs or directions. thanks
Upvotes: 1
Views: 5018
Reputation: 1660
If you just want to re-package a .box file that you were given, then you can try "vagrant box add " where the address is a URL or a physical address. Once that box is added, you can call "vagrant init" to generate your Vagrantfile and "vagrant up" to make a virtual machine based on your friend's base box. The folder that you're currently in then becomes the place where you do all future vagrant commands for this virtual machine.
Upvotes: 3
Reputation: 607
Having the box file is one of the steps to have a proper development environment configured. You also need to have the configuration file vagrantfile.
Vagrant is meant to run with one Vagrantfile per project. For example; if your project path is located at C:\vagrant\project01\, inside that folder you need to put the vagrantfile related to that box. Remember this file should contain the configuration for the box that you previously downloaded.
In the case that you don’t have this file but want to use the box to adapt it to you needs you can also can configure Vagrant for that. You just need to go to the cmd, and cd
(got to directory) folder of the project, in this case C:\vagrant\project01\. In the cmd windows type vagrant init
and Vagrant will generate a vagrantfile for this project. In that file you can modify the config.vm.box_url
parameter to point to your current box. This address could be a URI or the path to the box in your host machine for example “c:\virtualmachines\devel\machineboxname.box”.
Vagrant is so powerful that we have done no more than skim the surface of these topics.
Upvotes: 3
Reputation: 84373
Full documentation for Vagrant can be found on the website. From a practical point of view, a Vagrant box is just a provisioned VirtualBox VM.
If someone else gave you the box, they can show you how to log into it as well. After that, get coding!
Upvotes: 5