Terminal Doesn't Say Whether Vagrant Box Installed Successfully or Not - laravel

I'm having some issues installing Laravel/Homestead. When I ran the $ vagrant box add laravel/homesteadcommand everything went fine but I didn't see this line, ==> box: successfully added box 'laravel/homestead' (v0.4.2) for 'virtualbox'!" However, when I run the $ vagrant box add laravel/homesteadcommand again it shows the following below, which means that Laravel/Homestead was successfully installed, right? Or no? If not how would I delete all the vagrant files that I installed? Would I per the usual, go to the control panel and select uninstall program, or would that not be enough? Thanks for you help!
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://vagrantcloud.com/laravel/homestead
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) parallels
2) virtualbox
3) vmware_desktop
Enter your choice: 2
==> box: Adding box 'laravel/homestead' (v4.0.0) for provider: virtualbox
The box you're attempting to add already exists. Remove it before
adding it again or add it with the `--force` flag.
Name: laravel/homestead
Provider: virtualbox
Version: 4.0.0

Your first attempt did work, as the Vagrant is telling you that instance already exists... Use GitBash (assuming you are on windows) and once in terminal mode
cd ~/Homestead (or try cd ~/.Homestead)
vagrant up
If its all working - you will see the messages OK and if not, you'll get an error
Then you just go into your code folder where your projects will be created
cd ~/Code (code being the folder I want to create my Laravel projetcs)
composer create-project --prefer-dist laravel/laravel nameofproject
Not sure if above helps. in my example, the homestead files are in the /users/myuser/Homestead folder - but best of luck

Related

Laravel Homestead/Vagrant box error : The specified checksum type is not supported by Vagrant: sha512

I am trying to install laravel homestead and can't get past adding the homestead box.
The instruction is: vagrant box add laravel/homestead
After completing the download process following error appears.
C:\Users\HARSHA - PC PRO>vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://vagrantcloud.com/laravel/homestead
==> box: Adding box 'laravel/homestead' (v9.0.1) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/9.0.1/providers/virtualbox.box
==> box: Box download is resuming from prior download progress
box: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com
box: Progress: 100% (Rate: 188k/s, Estimated time remaining: --:--:--)
box: Calculating and comparing box checksum...
The specified checksum type is not supported by Vagrant: sha512.
Vagrant supports the following checksum types:
md5, sha1, sha256
I'm on Windows 10 64 bit PC and have tried these instructions with the virtualbox(Version 6.0.0 r127566 (Qt5.6.2)) and vagrant_2.2.2_x86_64 version.
I'm trying to install Laravel homestead and am not aware of resolving this since I am new to the Laravel vagrant. I searched the web for the particular problem and I could not find any solution pertaining to the above, so any help is appreciated.
As mentioned in Vagrant's CHANGELOG.md file, new checksum types are now supported. Simply updating Vagrant to its latest version (2.2.6) should do the trick.
You can then do vagrant box update to upgrade the Homestead box.
In my case I saw in the logs that the version trying to get installed was v9.2.2-alpha1
box: Adding box 'laravel/homestead' (v9.2.2-alpha1) for provider:
virtualbox
What worked for me is defining the version by using the following parameter
--box-version=9.1.1
i.e.
vagrant box add laravel/homestead --checksum-type=sha256 --box-version=9.1.1
Also, try to download and install the latest version of vagrant.
You are using the unsupported checksum type.try installing with --checksum-type parameter. Given below,
vagrant box add laravel/homestead --checksum-type sha256
Here is the Docs to refer to while using command-line.
Try 2.2.7 version.
vagrant -v
Vagrant 2.2.7
==> box: Successfully added box 'laravel/homestead' (v9.3.0) for 'virtualbox'!
I had the same problem and it took multiple attempts.
Problems
Couldn't update the vagrant box.
Once I downloaded it wouldn't switch to the new box.
Once I switched Laravel threw a Facade error.
Solution
(with many thank you's to the answers in this thread):
Navigate to the Homestead/Vagrant folder.
Then run "vagrant -v" to check your Vagrant version (ex. "Vagrant 2.1.5").
In a web browser go to https://www.vagrantup.com/downloads.html .
Download the latest Vagrant version.
On your computer, run and install the new version.
Go to: https://www.virtualbox.org/
Download the lastest Virtual Machine.
On your computer, run and install the new version.
Back in the terminal, check the vagrant version again "vagrant -v" (ex. "Vagrant 2.2.10").
Make sure your Vagrant is stopped by running "vagrant halt".
Purge and reinstall your vagrant plugins to be safe with "vagrant plugin expunge --reinstall" (and confirm "Y").
Now run "vagrant box update" to update your box.
Now load your box with "vagrant up".
With your box loaded run "vagrant destroy".
Now run "vagrant up" again to rebuild your box from scratch.
This worked for me. Let me know if this works for you.

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).

error when try to add box laravel/homestead

Today, I try to add box laravel homestead following document in laravel home page. But I have an error in my laptop using windows 8.1. The first step, I installed vagrant, virtualbox and using syntax vagrant box add laravel/homestead. It's will show error log in git bash :
The box 'laravel/homestead' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/laravel/homestead"]
Error:
Then I try syntax: vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead. It's will show error:
$ vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'laravel/homestead' (v0) for provider:
box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead
box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Again, I run : rm ~/.vagrant.d/tmp/* and vagrant up. But not working.In addition, another computer everything good.What can I do, anyone?
If you are having a similar issue try checking the curl or you can simple copy one if you are using git bash under Windows.
cp /mingw64/bin/curl.exe /c/HashiCorp/Vagrant/embedded/bin/curl.exe

Problem while Installing The Homestead Vagrant Box

I'm using ubuntu 14.04, and I'm trying to setup larave/Homestead. But while installing Homestead Vagrant Box I lost internet connection in middle, later on I tried to reinstall it using '$ vagrant box add laravel/homestead'
command line, but it prompts following errors while reinstalling.
1) virtualbox
2) vmware_desktop
Enter your choice: 1
==> box: Adding box 'laravel/homestead' (v0.3.3) for provider: virtualbox
box: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.3.3/providers/virtualbox.box
==> box: Box download is resuming from prior download progress
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
HTTP server doesn't seem to support byte ranges. Cannot resume.
I tried reinstalling vagrant but this didn't work.
You need to clear the temporary files generated by Vagrant.
This can be achieved in three ways:
Force Clean Install
Add a parameter --clean as such $ vagrant box add laravel/homestead --clean
Manual Deletion
Navigate manually to vagrants temporary folder, by hitting cmd+space and typing ~/.vagrant.d/tmp/, and remove files located there.
Terminal
Open the terminal and remove the temporary files generated by
vagrant:
rm ~/.vagrant.d/tmp/*
Thanks #Nicklas for your quick response. But I solved it adding '-c' flag at end.
$ vagrant box add laravel/homestead -c
This removed files associated with it allocated in .vagrant.d/tmp/
The easiest option is to force the installer to clean the old files, so you just need to use this command
$ vagrant box add laravel/homestead --clean
source

Download vagrant box file locally from atlas and configuring it

I want to download a vagrant box file from Atlas for using it later locally with my vagrant file. How can I do this, and how can I configure it?
To download a file you have to add version and provider in the URL. For example for downloading trusty64 First you need its URL which is
https://app.vagrantup.com/ubuntu/boxes/trusty64/
then you have to add version and provider afterwards, for our example the download URL would be.
https://app.vagrantup.com/ubuntu/boxes/trusty64/versions/20180206.0.0/providers/virtualbox.box
Then you have to add it locally from your vagrant file.
To add it locally to vagrant file use the following command
vagrant box add foo-box /path/to/vagrant-box.box
vagrant init foo-box
vagrant up
This will create the vagrantfile and you can configure the vagrant file.
However, this will add the box as version 0.
○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'ubuntu/trusty64' (v0) for provider:
box: Unpacking necessary files from: file:///Users/ram/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> box: Successfully added box 'ubuntu/trusty64' (v0) for 'virtualbox'!
vagrant does not allow to specify a version number of the manually added box
○ → vagrant box add ubuntu/trusty64 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box --box-version 20151021.0.0
==> box: Box file was not detected as metadata. Adding it directly...
You specified a box version constraint with a direct box file
path. Box version constraints only work with boxes from Vagrant
Cloud or a custom box host. Please remove the version constraint
and try again.
To update the version number of the box, change the folder name '0' in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/0 to the version number you downloaded. For example '20160120.0.0'
|2.2.3| MacBook-Pro in ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64
○ → mv 0 20160120.0.0
now you are all set to update the version next time with vagrant command too
○ → vagrant box list
ubuntu/trusty64 (virtualbox, 20160120.0.0)
I faced the same issue not being able to download from script. So manually downloaded the box and added to vagrant as below,
you can get versions you want from here - https://atlas.hashicorp.com/ubuntu/boxes/precise64
wget https://atlas.hashicorp.com/ubuntu/boxes/precise64/versions/20160818.0.0/providers/virtualbox.box
cd my_vagrant_project
vagrant box add precise64 ~/Downloads/precise-server-cloudimg-amd64-vagrant-disk1.box
vagrant init precise64
vagrant up
Download virtualbox.box:
https://app.vagrantup.com/laravel/boxes/homestead/versions/6.4.0/providers/virtualbox.box
You can change the version(6.4.0) of homestead box with the Current Version.
Current version: 6.4.0.
Check for the latest version here: https://app.vagrantup.com/laravel/boxes/homestead
After downloading the box, rename it to virtualbox.box
Don't forget to include the .box extension.
Add the downloaded homestead box to vagrant:
vagrant box add laravel/homestead file:///f:/virtualbox.box
Change the Drive( c: or d: or e:) or Path(c:/folder1/folder2/virtualbox.box) to the location where you have stored your downloaded homestead box.
You will get success massage like image below:
Update homestead box
Navigate to vagrant directory:
c:/users/YourUserName/.vagrant.d/boxes/laravel-VAGRANTSLASH-homestead
After that, Create a file called metadata_url
NOTE: There is no extension for metadata_url
Then add the link below and save the file
https://app.vagrantup.com/laravel/homestead
Do not add a newline after link in above file.
Rename folder 0 to 6.4.0
6.4.0 is your homestead box version.
And it's Done. Hope it help.
First: check latest version from this link Here
Update:you can try by go to the mentioned link above ,to get the number of latest version,then try to change the version in bellow URL
for now the latest version is:7.2.1
for virtualbox:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/virtualbox.box
for hyperv:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/hyperv.box
for vmware:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/vmware_desktop.box
for parallels:
https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/parallels.box
Maybe in the future the link changed so try to get download vagrant box by using command on your terminal/CMD by command
vagrant box add laravel/homestead
choose your virtualization method
then you will see the download link *ended with .box, after that you can cancel it CTRL+C and copy the download link and download it locally by using IDM/aria2c -x16 etc.
Second: Use this command
vagrant box add laravel/homestead {Path of file from your local computer}
Third:add metadata by go to
1- you create a file called metadata_url
NOTE: There is no extension for metadata_url
2- Then add this link and save the file
https://atlas.hashicorp.com/laravel/homestead
3- Copy metadata_url file to:
for windows go to
%userprofile%.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead
4- Then rename the folder named 0 to the version of the current homestead version = 7.2.1
I hope this help
for more information
Laravel
metadata
If you have the ubuntu-VAGRANTSLASH-trusty64 folder from someone else machine you can simply copy paste the folder to
~/.vagrant.d/boxes
and use the vagrant up to start the servers. This way you do not need to add the trusty64 box manually.
Instructions for OSX/Fusion:
wget https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/vmware_fusion.box
# For some reason, the downloaded filename was set to an uuid
# mv <uuid> vmware_fusion.box
vagrant box add hashicorp/precise64 vmware_fusion.box
cd vagrant.d/boxes/hashicorp-VAGRANTSLASH-precise64
mv 0 1.1.0
echo -n "https://app.vagrantup.com/hashicorp/boxes/precise64" > metadata_url
vagrant box list
I try to use vagrant up and I got URL to download box file:
https://vagrantcloud.com/centos/boxes/7/versions/1801.02/providers/virtualbox.box

Resources