Add Vagrant .box file failing - vagrant

Instead of running vagrant box add ubuntu/trusty64 I want to download the .box file manually (like in this question).
I downloaded the file from here:
https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box
When I run vagrant box add test123 ~/Downloads/trusty-server-cloudimg-amd64-vagrant-disk1.box the following output results:
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'test123' (v0) for provider:
box: Unpacking necessary files from: file:///XYZ/trusty-server-cloudimg-amd64-vagrant-disk1.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
(There is no further error message)

If your vagrant version Vagrant 1.8.7 you can try this.
sudo rm -rf /opt/vagrant/embedded/bin/curl
This worked for me.

Related

Vagrant is failing to unpackage Ubuntu Bionic box

I've tried the following on two different hosts (MacOS and Windows 10):
vagrant init ubuntu/bionic64
vagrant up
However on both machines I get the same error:
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'bionic' (v0) for provider:
box: Unpacking necessary files from: file:///Users/user/Downloads/bionic-server-cloudimg-amd64-vagrant.box
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and that enough disk space
is available and then try again.
The output from attempting to unpackage (if any):
x box.ovf
x Vagrantfile
x metadata.json
x ubuntu-bionic-18.04-cloudimg.mf
x ubuntu-bionic-18.04-cloudimg.vmdk: Truncated tar archive
bsdtar: Error exit delayed from previous errors.
So far, I've tried:
freeing up 20GB of disk space
downloading the box and manually untarring it
using older versions of this vagrant box from months ago
but I am still unable to get past this error. Help?
This appears to be a known widespread issue with the Bionic images. The following is a workaround until it's fixed:
Download the box manually from here
Run vagrant box add --name ubuntu/bionic64 /path/to/bionic-server-cloudimg-amd64-vagrant.box
Try vagrant up again
I've been having that issue for a while now. I would just go with the hashicorp box for Ubuntu 18 (bionic64)
Vagrant.configure("2") do |config|
# Ubuntu 18 (bionic64) from Hashicorp
config.vm.box = "hashicorp/bionic64"
end

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

Vagrant box add fail

I was trying to add
laravel/homestead
box in vagrant but i get different errors.
By running
vagrant box add laravel/homestead
I get this error
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:
I tried to 'vagrant login' and i logged in successfully but still receiving same error.
I tried to download the box manually, However, I still having problems adding it.
by running this command
vagrant box add laravel/homestead [Path in Windows]
i get
==> box: Adding box 'laravel/homestead' (v0) for provider:
box: Unpacking necessary files from: file://C:/Users/eNull/Downloads/hc-download
box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
My OS: Windows 10.
cUrl version: curl 7.45.0 (x86_64-w64-mingw32) libcurl/7.45.0 OpenSSL/1.0.2d zlib/1.2.8 libidn/1.32 libssh2/1.6.0 librtmp/2.3
vagrant: 1.8.1
VirtualBox: 5.0.12
You don`t need to add the box from web. Init instead of this:
vagrant init laravel/homestead
vagrant up
vagrant ssh
Vagrant should add homestead in boxes list automatically.
If you want to set up local downloaded box, you will be get better to add box directly from box directory.:
cd [path in windows]
vagrant box add [name_box] laravel/homestead
vagrant up
vagrant ssh
Fixed.
I downloaded
cUrl x64 with SSL
and replace it with the curl.exe provided by Vagrant.
In other words, I copied the curl.exe to
C:\HashiCorp\Vagrant\embedded\bin
Now it's working perfect.
vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead
use chocolate down cUrl,and replace it with the curl.exe provided by Vagrant. then it works.
I find error by script: vagrant box add {box path} --debug

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

turning files into .tar in vagrant

i've tried fixing the problem "bsdtar: Error opening archive: Unrecognized archive format" #161 but i didnt find an anwser ,
(im using 1.7.4 vagrant which is the latest version.
i tried this approach first :
C:\Users\1>vagrant box add pip C:\Users\1\Desktop
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'pip' (v0) for provider:
box: Unpacking necessary files from: file://C:/Users/1/Desktop
box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file /Users/1/Desktop
after failing i tried importing the file through a url,making me get the error on top.:
C:\Users\1>vagrant box add pip https://bootstrap.pypa.io/get-pip.py
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'pip' (v0) for provider:
box: Downloading: https://bootstrap.pypa.io/get-pip.py
box: Progress: 100% (Rate: 826k/s, Estimated time remaining: --:--:--
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):
bsdtar.EXE: Error opening archive: Unrecognized archive format
Vagrant expects either a box path/url or a name of the box that is available on Vagrant Atlas. You give it just arbitrary things that do not contain a box.
To e.g. download the Ubuntu Trusty x64 box, use
vagrant box add ubuntu/trusty64

Resources