when looking up "vagrant up" it gives unsatisfactory information on getting vagrant working - vagrant

when looking for vagrant up this is what you get: Error when trying vagrant up
. I didn't find this particularly helpful so what the correct answer is you need to go to, https://app.vagrantup.com/boxes/search and find a recent box. The box written about in the previous answer doesn't exist.

So the answer should be:
Run vagrant init in the directory you want to use; this will create a file called Vagrantfile.
After which go to the url above and find a box you want.
Open Vagrantfile and under config.vm.box = prefered/box edit the box to your preferred box that you found in search.
After you have modified your Vagrantfile file run the command vagrant up. This will download the box.
Success!

Related

how to add a local box file into vagrant box

I'm learning vagrant( https://www.vagrantup.com/intro/getting-started/boxes.html ) ,because I can't directly "vagrant box add hashicorp/precise64" as is written on the page, first I downloaded hashicorp/precise64, then added it. It said "box:successfully added box 'hashicorp/premise64'(v0) for virtualbox". Then I configured vagrantfile as is written on the page.But when I "vagrant up",it said"Box 'hashicorp/premise64' could not be found'. ..... Process 0%......".I've been searching a solution, but can't find.Can someone help? Thanks!
Awesome to see you trying out Vagrant as it is a very useful tool. Some background on hashicorp/precise64, this box is popular yes, but is a dated version of Ubuntu 12.04. I would recommend using ubuntu/xenial64 which is Ubuntu 16.04. To use this you will first run:
vagrant init ubuntu/xenial64
then
vagrant up
This process may take some time as it is initializing the box for the first time. Once it is up and running feel free to ssh into it:
vagrant ssh
I also recommend taking a look at their quick start guide here.

The 'host_compress_magento_code' provisioner could not be found

So I'm trying to install a second vagrant VM, specifically configured for Magento 2. Which I found here: https://github.com/paliarush/magento2-vagrant-for-developers
on windows 10.
I couldn't clone the repository, because I got "Access denied", so instead I just downloaded the rar and extracted it into a folder.
Afterwards I launched my GitBash and did "vagrant up" into the folder.
After about an hour of downloading I get this error:
"There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The 'host_compress_magento_code' provisioner could not be found."
Additionally it had a problem with hosts manager as well, but I quickly found out I can do "vagrant plugin install vagrant-hostmanager" and it solved that error, but the missing "host_compress_magento_code" continues to not let me up the vagrant.
In "Vagrantfile" I found the following line:
config.vm.provision "host_compress_magento_code", type: "host_shell", inline: "tar -cf scripts/host/magento2ce.tar magento2ce"
Quick search about the command lead me to believe that it needs "magento2ce" file in the vagrant root dir in order to create that "magento2ce.tar" archive.
But I have no clue what that file should be.
Can anyone point me in the right direction? Google searches just lead to threads where "vagrant plugin install vagrant-hostmanager" has been the solution.
Thanks in advance!
After cloning of Vagrant Box for Magento 2 Developers you should (simplified version):
Copy etc/composer/auth.json.dist to etc/composer/auth.json.
Add the Magento Marketplace keys for Marketplace authorization to the repo.magento.com section.
Run init_project.sh
Please, read more carefully Installation steps section. It contains more details of how you can configure and work with this vagrant box.
init_project.sh install all needed vagrant plugins and after that run vagrant up. After you init of project you can work as ordinary vagrant suspend, vagrant resume and etc

Vagrant: "The box you're attempting to add already exists"

I am pretty new to Vagrant and already I seem to have hit a snag with it. I am basically following their get started guide.
When I type the command:
$ vagrant box add hashicorp/precise64
I get this error:
The box you're attempting to add already exists. Remove it before
adding it again or add it with the --force flag.
Name: hashicorp/precise64
Provider: virtualbox
Version: 1.1.0
Here is what I have tried.
I destroyed it first using:
$ vagrant destroy
I then backed out into documents using:
$ cd -
I then removed the director with:
$ rm -rf vagrant_getting_started
Then I created a new directory with:
$ mkdir vagrant_getting_started
I then went into that directory with:
$ cd vagrant_getting_started
Then I typed:
$ vagrant box add hashicorp/precise64
Which gave me:
==> box: Loading metadata for box 'hashicorp/precise64'
box: URL: https://vagrantcloud.com/hashicorp/precise64
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) hyperv
2) virtualbox
3) vmware_fusion
Enter your choice:
Finally I chose option 2 and then this is where the error is.
Can anyone see anything that I am doing wrong?
vagrant box remove -f laravel/homestead will remove the "laravel/homestead" from your machine and you can reinstall the same by vagrant box add laravel/homestead.
Unless the Vagrant box image has become corrupted, you don't need to download it again to re-use it.
Vagrant only downloads the boxes it doesn't have. Once a box image is saved locally on your system, Vagrant will use the local image to work from.
When setting up a new Vagrant based project, the following will happen:
You create or navigate to your project directory
Run vagrant init hashicorp/precise64. This will initialise Vagrant inside the directory, and create a new Vagrantfile if one doesn't exist. It also tells Vagrant which box image to use. If the box image is already stored locally - it won't download it.
Alternatively, if you already have a Vagrantfile in your project directory, simply run vagrant up. Vagrant will take care of everything for you - including downloading the box image (if applicable).

Download vagrant boxes via tutorial syntax

About to start tinkering with vagrant, looking at the second page of the tutorial
vagrant box add hashicorp/precise64
When I run this command however, I get
This command was not invoked properly. The help for this command is
available below.
Usage: vagrant box add [--provider provider] [-h]
I can see it takes a name before the URL, so I tried
vagrant box add ubuntu/trusty64 https://atlas.hashicorp.com/ubuntu/boxes/trusty64
but I get another error
bsdtar: Error opening archive: Unrecognized archive format
I want to download ubuntu/trusty64 specifically. What am I doing wrong?
You are using old version of Vagrant with newest documentation. You either need to update your Vagrant or read old docs.
Boxes system was revamped in 1.5 so your Vagrant is older than 1.5
I used a different site to get the boxes. The url needs to have a .box file
https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box

mlstate/opa vagrant box installation issue

I stumble upon the OPA framework for Javascript and decided to give it a shot.
Prefering a Vagrant Box, I did as suggested:
vagrant init mlstate/opa
vagrant up
but unfortunately it failed: Allegedly the box file is corrupted as bsdtar.exe couldn't even recognize the format while unpacking it.
What can I do, I need an official OPA Vagrant Box up and running on my Win7 machine to harness it.
I have the same problem on my Mac laptop. Installing the Vagrant Box from Vagrant Cloud does not seem to be working...
In alternative, you can try downloading the box file using the torrent on this link : http://opalang.org/Opa%20vagrant%20box.torrent
Once the box file is downloaded, issue the following commands :
vagrant box add opa-box file:///your_path_to_downloaded_file/opa.box
vagrant init opa-box
vagrant up
vagrant ssh
This works on my machine.
It's because the link leads to a redirect page to Google Drive. Bsdtar cannot open the archive because it's an HTML file. You can download it and add it using imikael21's instructions.
Here's the link it leads to: https://drive.google.com/uc?export=download&id=0B1UEOBxsn2GiN3ZpbFdMek1FNjQ
The attempted link: https://vagrantcloud.com/mlstate/opa/version/1/provider/virtualbox.box

Resources