turning files into .tar in vagrant - windows

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

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

Add Vagrant .box file failing

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.

'vagrant up' gives 'An error occurred while downloading'

I use Vagrant on my Linux and OS X machines without problem.
Now on Windows 10 (the preview with Bash for Windows) it fails while downloading my box, without specifying a proper error message:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'trusty' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'trusty' (v0) for provider: virtualbox
default: Downloading: http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
I also tried downloading the box (so the URL is correct!) and adding it manually but this results in the same:
C:\> vagrant box add ubuntu/trusty64 c:\Users\michi\boxes\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://c:/Users/michi/boxes/trusty-server-cloudimg-amd64-vagrant-disk1.box
box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
I found the answer in this github issue: https://github.com/mitchellh/vagrant/issues/6725#issuecomment-223733553
I installed the VC++ 2010 redistributable and vagrant up worked immediately!

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

Can't install laravel homestead

I'm trying to get laravel set up on my Windows 8.1, but keep running into errors. Can anyone advise what's going wrong here and how I can sort it? I have vagrant and virtualbox setup as required. Thanks.
C:\Users\Robin>vagrant box add laravel/homestead
==> box: Loading metadata for box 'laravel/homestead'
box: URL: https://atlas.hashicorp.com/laravel/homestead
==> box: Adding box 'laravel/homestead' (v0.2.2) for provider: virtualbox
box: Downloading:
https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.2/providers/virtualbox.box
box: Progress: 100% (Rate: 582k/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):
x ./box-disk1.vmdk: Write failed
x ./box.ovf: Write failed
x ./Vagrantfile: Can't create '\\\\?\\C:\\Users\\Robin\\.vagrant.d\\tmp\\vagrant-box-add-temp-
20150112-14824-106nj0l\\Vagrantfile'
bsdtar.EXE: Error exit delayed from previous errors.
For me the problem was that the download of the box was not successful completely, but the file was "corrupt". You can retry the command multiple times, because vagrant resumes the download from previous failed download:
vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead
try this command :
vagrant box add laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead
please tell me if it worked or i'll delete it (i'm not able to comment)

Resources